The younger brother today records the simple use of MySQL below the Linux system, as follows:
Services start and close view versions started and closed
Environment
Linux version: Centeros 6.6 (Demo below), Ubuntu 12.04 (see the article at the end of the Red label font)
MySQL version: 5.1.73
To view the startup status of the MySQL service,
Input command:/ETC/INIT.D/MYSQLD status
Or: Service mysqld status
Example diagram:
Or
Then start the MySQL service,
Input command: Service mysqld start
Or:/etc/init.d/mysqld start
Example diagram:
Or
The discovery failed to start, this is due to not using administrator state to start, the following switch to the administrator state to try again,
Example diagram:
Then log in,
Input command: mysql–uroot–p123456 (123456 for password)
Or: Mysql–uroot-p (enter, then password)
Example diagram:
View MySQL version,
Input command: Select version ();
Example diagram:
Quit (Close) MySQL,
Input command: Exit
Example diagram:
Close the service,
Input command: Service mysqld stop
Or:/etc/init.d/mysqld stop
Example diagram:
Or
Note: The above is done under the Center OS system, the younger brother in the Ubuntu system is also tested, unlike the center OS, Ubuntu need to use the Center OS inside the command of the mysqld behind the D removed, All of the commands shown above can be replaced with MySQL directly using mysqld.
Article from: http://www.2cto.com/database/201501/372605.html
Play MySQL Linux simple operation (service start and close, start and close, view version)