Skip to main content

Posts

Showing posts with the label mysql

How to reset MySQL root password in Ubuntu in latest Ubuntu versions 18.04 and above

I have forget my MySQL root password and not able to login in phpMyAdmin. I am very bad in MySQL commandline. After long struggle while Googling, I found this solution in Stackoverflow - But this will work only latest Ubuntu version because of enhance security of MySQL.  First, as root, stop the mysql server.  systemctl stop mysql Next, create a /var/run/mysqld directory to be used by MySQL process to store and access socket file:  mkdir -p /var/run/mysqld chown mysql:mysql /var/run/mysqld Check that the newly created directory do exist. Now manually start MySQL with the following linux command and options:  /usr/sbin/mysqld --skip-grant-tables --skip-networking & Confirm that the process is running as expected:  jobs [1]+ Running sudo /usr/sbin/mysqld --skip-grant-tables --skip-networking;  Leave that terminal running and open another terminal, not as root. Now access MySQL database without password:  mysql -u root -p mysql> Using the MySQL ses...