Skip to main content

Posts

Access denied for user 'root'@'localhost'

f you have that same problem in MySql 5.7.+ : Access denied for user 'root' @ 'localhost' it's because MySql 5.7 by default allow to connect with socket, which means you just connect with  sudo mysql . If you run sql : SELECT user , authentication_string , plugin , host FROM mysql . user ; then you will see it : + ------------------+-------------------------------------------+-----------------------+-----------+ | user | authentication_string | plugin | host | + ------------------+-------------------------------------------+-----------------------+-----------+ | root | | auth_socket | localhost | | mysql . session | * THISISNOTAVALIDPASSWORDTHATCANBEUSEDHERE | mysql_native_password | localhost | | mysql . sys | * THISISNOTAVALIDPASSWORDTHATCANBEUSEDHERE | mysql_native_password | localhost | | debian-sys-ma...
Recent posts

Magento 2 Preview order email

<?php use Magento\Framework\App\Bootstrap ; require __DIR__ . '/app/bootstrap.php' ; $params = $_SERVER ; $bootstrap = Bootstrap:: create ( BP , $params ) ; $objectManager = $bootstrap -> getObjectManager () ; $state = $objectManager -> get ( 'Magento\Framework\App\State' ) ; $state -> setAreaCode (\Magento\Framework\App\Area:: AREA_GLOBAL ) ; /* $orderId = 853;// Put your Order Id Here \Magento\Store\Model\App\Emulation $appEmulation, \Magento\Email\Model\TemplateFactory $emailFactory $order = $objectManager->create('\Magento\Sales\Model\Order')->load($orderId); */ $emailFactory = $objectManager -> create ( '\Magento\Email\Model\TemplateFactory' ) ; $appEmulation = $objectManager -> create ( '\Magento\Store\Model\App\Emulation' ) ; $emailSender = $objectManager -> create ( '\Magento\Sales\Model\Order\Email\Sender\OrderSender' ) ; $paymentHelper = $objectManager -> create ( '\Magento\Payment\Helper\Data...