Mysql the installation
Installed version: msyql-5.5.39.tar.gz
installation machine:BASELINE01
Installation process:
- log in to baseline01, switch user name root, and enter the directory where the package is located:
$ su-root
# Cd/opt/software
- Configure the MySQL user (password is also set to MySQL):
# Groupadd MySQL
# useradd-r-G MySQL MySQL
- Extract the mysql-${version}.tar.gz through the TAR-XF command to the destination installation directory, and set the soft connection, the configuration directory belongs to the MySQL account, MySQL group. Such as
# TAR-ZXVF Mysql-${version}.tar.gz-c/usr/local
# Chown-r mysql:mysql/usr/local/mysql-${version}/
# ln-s/usr/local/mysql-${version}/MySQL
# Cd/usr/local/mysql
# chown-r Mysql:mysql MySQL
# Ln-s/usr/local/mysql/lib/libmysqlclient.so.18.0.0/usr/lib64/libmysqlclient.so.18 ( Prevent errors that cannot be found libmysqlclient.so.18)
- Initialize MySQL:
# Cd/usr/local/mysql
# scripts/mysql_install_db--user=mysql
# CP SUPPORT-FILES/MY-MEDIUM.CNF/ETC/MY.CNF
# CP Support-files/mysql.server/etc/init.d/mysql.server
- To start the MySQL service:
#/usr/local/mysql/support-files/mysql.server Start
if it appears Starting MySQL. The success! result represents a successful start.
- Start MySQL on baseline01, go to MySQL, change password and permissions:
# mysql-u Root
#mysql > Set password = password ("1234");
#mysql > GRANT All privileges on * * to ' root ' @ '% ' identified by ' 1234 ';
#mysql > GRANT All privileges on * * to ' root ' @baseline01 identified by ' 1234 ';
#mysql >flush privileges;
entered MySQL, and the password modification succeeds, it means that MySQL installation and boot success
Note: If the following error occurs during startup, the solution is as follows:
Google, the problem may be caused by a variety of reasons, the best way is to check the error log first:
1. may be/usr/local/mysql/data/rekfan.pid file does not have permission to write
WORKAROUND: Give permission to execute "chown -R mysql:mysql /var/Data" "Chmod-r 755/usr/local/ Mysql/data "and then restart mysqld!
2. The MySQL process may already exist in the process
WORKAROUND: Use the command "Ps-ef|grep mysqld" to see if there is a mysqld process, kill with "kill-9 process number" and then restart mysqld!
3. It may be the second time that MySQL is installed on the machine, with residual data affecting the start of the service.
Workaround: Go to MySQL data directory/data See, if there is mysql-bin.index, quickly delete it, it is the culprit. I am using the third method to solve! http://blog.rekfan.com/?p=186
4.mysql The/ETC/MY.CNF profile is used when the configuration file is not specified at startup, please open this file to see if there is a specified data directory (DATADIR) under the [Mysqld] section.
WORKAROUND: Please set this line under [mysqld]: DataDir =/usr/local/mysql/data
5.skip-federated Field Issues
Workaround: Check the/etc/my.cnf file for any skip-federated fields that have not been commented out, and if so, comment them out immediately.
6. Error log directory does not exist
Workaround: Use "Chown" "chmod" command to give MySQL owner and permissions
7.selinux, if it is a CentOS system, the default is to turn on SELinux
Workaround: Turn it off, open the/etc/selinux/config, change the selinux=enforcing to selinux=disabled, and then save the restart machine and try again.
installing MySQL on Linux