First, the MySQL Startup and Shutdown
1, MySQL start rationale explanation
2, the system startup method MySQL output analysis initialization verse cry
mysqld_safe --user = mysql & Tips: 1 , when the root password back, often Warriors mysqld_safe --user = mysql & arguments start 2 , we ourselves might use this method to start the development of a script to start the database 3 , / etc / init.d / mysqld and mysqld_safe --user = mysql & start essence is the same
3, elegant method to close the database
Close principle is actually kill the process number, in general, do not use the pkill or killall forced to shut down the database, the database will lead to mountains
The first method mysqladmin: mysqladmin -uroot-- poldboy123 the shutdown second script comes /etc/init.d/ mysqld STOP third method of kill signals kill -USR2 `CAT path / pid` Tip: two months ago recommendation method, write your own script starts with the first stop on a
Second, MySQL login method
1, a single instance of MySQL login method
Forced Linux command history does not record sensitive
HISTCONTROL = ignorespace
command preceded by a space inside the command history will not record the commands you entered
1) modify the command line login prompt
MySQL> prompt \ U Dubin @ \ R & lt: \ m: \ S-> the PROMPT SET to ' \ U Dubin @ \ R & lt: \ m: \ S-> ' the root Dubin @ 08 : 54 is : 12 is -> ## temporarily change , re-board failure
2) configuration file to modify the login prompt (permanent changes)
2, multi-instance MySQL landing approach
Third, after landing MySQL
Fourth, make good use of the MySQL command help help
1, the general troubleshooting the problem, we must look at the fault log, based on the output or error log file itself under investigation, do not forget this is a rare opportunity God has given you a promotion, but a miss, it will give someone else the opportunity to upgrade .
2, it can not be resolved, then the search (g> b) better, keyword search elements to be refined and unique as possible.
3, the official manual for help or knowledge of learning, usage, view of the best software, a direct first-hand information.
4, really do not understand English, you can search for Chinese data, then change the control side of the official manual or help learning English software, used to watch will be the English. Most Chinese Internet data are incomplete or even a problem, there is no ability to work hard to get the rookie.
Fifth, exit MySQL data method
There Ctrl + d
Sixth, set and modify the MySQL root password
1, MySQL database user security policy introduced
After you install mysql database, the default root administrator password is blank, it is not safe. So we need to set a password. In fact, after installing MySQL single instance, we have done some safety measures: for example:
a. Set a password for root
b. Delete unwanted mysql library user accounts
c. Remove the default existence test database
* In addition to the above method, the MySQL database for the user's process, we have a more rigorous approach is as follows.
2, set a password for the administrator user root method
3, change the administrator password law a root: modify the command line outside the law
4, modify administrator root Secrets Act II: aql statement modifies Law
prompt:
1, you must specify where conditions
2, you must use the password () function to change the encryption password.
5, change the administrator password for root Act III: