1>>> yum install mysql mysql-server -y
2>>> service mysqld start
3>>> chkconfig mysqld on
4>>> /usr/bin/mysqladmin -u root password '1234'
5>>> ln -s /var/lib/mysql/mysql.sock /tmp
5、修改mysql及授权物理机连接mysql
授权物理机命令:
mysql -u root -p
GRANT ALL PRIVILEGES ON *.* TO root@"192.168.1.2" IDENTIFIED BY '1234' WITH GRANT OPTION;
(192.168.1.2为系统物理机IP地址)
添加mysql外网可链接帐号
1>>> mysql -u root -p1234 -e 'grant all on *.* to root@"%" identified by "1234";'
2>>> mysql -u root -p1234 -e 'grant all on *.* to root@"127.0.0.1" identified by "1234";'
3>>> mysql -u root -p1234 -e 'flush privileges;'