Install mysql under centos

下载:Percona-Server-5.6.15-rel63.0-519.Linux.x86_64.tar.gz
useradd -s /sbin/nologin mysql
mkdir /data/mysql/data -p
mkdir /data/mysql/log -p
alias cp=cp
yum install gcc* -y
cp -f /root/my.cnf /etc
tar -xzf /root/Percona-Server-5.6.15-rel63.0-519.Linux.x86_64.tar.gz -C /usr/local
ln -s /usr/local/Percona-Server-5.6.15-rel63.0-519.Linux.x86_64 /usr/local/mysql
ln -s /usr/lib64/libssl.so.10 /usr/lib64/libssl.so.6
ln -s /usr/lib64/libcrypto.so.10 /usr/lib64/libcrypto.so.6
cd /usr/local/mysql
./scripts/mysql_install_db --defaults-file=/etc/my.cnf --user=mysql
cp /usr/local/mysql/support-files/mysql.server /etc/init.d/mysql
ln -s /usr/local/mysql/bin/mysql /usr/bin/
/etc/init.d/mysql start
echo "/usr/local/mysql/lib" >> /etc/ld.so.conf.d /mysql-x86_64.conf
ldconfig


Copy the my.cnf file to /usr/local/mysql/
Modify the path of mysql.sock in the my.cnf file, find the location of the mysql.sock file and change it (under the root directory: find / mysql .sock)
Restart the database: /etc/init.d/mysql restart


enter mysql
mysql -S /var/lib/mysql/mysql.sock

GRANT
ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY '123456 ' WITH GRANT OPTION; 

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326641511&siteId=291194637