MySQL database startup and Shutdown
MySQL database server usually refers to mysqld, while command line mysql is a mysql client program. These two concepts are often confusing. Generally, the mysql server is started to start the mysqld process. After mysqld is started, you can connect to the mysql server through mysql. This article describes how to start a mysql server and how to disable it.
1. Start directly with mysqld
# Current mysql server running environment
2. mysql secure startup (mysqld_safe)
# Use mysqladmin to disable the mysql server that was previously started
# Use mysqld_safe to start the instance
# View background processes after startup
[Root @ rhel64a ~] # Mysql-uroot-pxxx-P3306 -- protocol = tcp
Root @ localhost [(none)]> select databases ();
3. mysql (mysql. server) Service Startup
# First, use mysqladmin to disable the existing mysqld.
[Root @ rhel64a ~] # Ls-hltr/etc/init. d/mysql #/etc/init. d directory has configured the mysql STARTUP script. Add
[Root @ rhel64a ~] #/Etc/init. d/mysql -- help # obtain mysql STARTUP script help
# By default, mysql has been added to the system directory as a service and configured to start automatically, as shown below:
4. Shut down the mysql server
5. Summary