MySQL Installation notes
After learning RedHat for a period of time, it is necessary to take notes. The following are the installation notes of MySQL,
I hope you will correct the error.
● Install MySQL
# Tar zxvf mysql-5.0.32.tar.gz
# Cd/tmp/mysql-5.0.32
# Groupadd MySQL
# Useradd mysql-G mysql-m-S/bin/false
#./Configure -- prefix =/opt/MySQL \ specify the installation directory
-- With-extra-charsets = gb2312 \ added support for gb2312 Chinese Characters
# Make
# Make install
# Scripts/mysql_install_db \ generate MySQL user database and table files
# Cp support-files/my-medium.cnf/etc/My. the CNF \ copy configuration file is available in three environments: large, medium, and small. Depending on the machine performance, if the load is heavy, you can modify the memory usage values of some variables.
# Cp support-files/MySQL. Server/etc/init. d/mysqld \ Copy mysqld file started
# Chmod 700/etc/init. d/mysqld
# Cd/OPT
# Chmod 750 mysql-R
# Chgrp MySQL mysql-R
# Chown MySQL/var-R
# Cd/opt/MySQL/libexec
# Cp mysqld. Old
# Strip mysqld
# Chkconfig -- add mysqld
# Chkconfig -- level 345 mysqld on
# Service mysqld start
# Netstat-atln
Check whether port 3306 is enabled. If mysqld cannot be started, check the error logs in/opt/MySQL/var. This is generally because the directory permission is not set.
# Ln-S/opt/MySQL/bin/MySQL/sbin/MySQL
# Ln-S/opt/MySQL/bin/mysqladmin/sbin/mysqladmin
# Mysqladmin-uroot password "youpassword" # Set the password of the root account
# Mysql-uroot-P
# Enter your password
Mysql>; use MySQL;
Mysql>; delete from user where Password = ""; # delete an empty password account used for anonymous local connection
Mysql>; flush privileges;
Mysql>; quit