This article is half-done without your Comment! *** Please share your thoughts via Comment ***
In this post, I am sharing few important commands for MySQL and Ubuntu.
Let’s first see the MySQL Command:
You can execute this all commands in the root directory of the MySQL.
Check MySQL is running or not:
1 |
mysqladmin -u root -p ping |
Check MySQL Current Version:
1 |
mysqladmin -u root -p version |
Check MySQL Current Status:
1 |
mysqladmin -u root -p status |
Check MySQL Server Variables:
1 |
mysqladmin -u root -p variables |
Check status of MySQL Server variable’s values:
1 |
mysqladmin -u root -p extended-status |
Check running all MySQL Server Processes:
1 |
mysqladmin -u root -p processlist |
Safely Shutdown of MySQL:
1 |
mysqladmin -u root -p shutdown |
Let’s see the Ubuntu Commands:
Check MySQL is running or not:
1 |
sudo netstat -tap | grep mysql |
Start MySQL Service:
1 |
sudo start mysql |
Restart MySQL Service:
1 |
sudo service mysql restart |
Stop MySQL Service:
1 |
sudo stop mysql |
Check Status of MySQL Service:
1 |
service mysql status |
Check MySQL Config File:
1 |
sudo nano /etc/mysql/my.cnf |
To Change MySQL Root Password:
1 |
sudo dpkg-reconfigure mysql-server-5.5 |
You can also visit this article to reset MySQL Root Password: