mysql安装使用

在线安装Mysql
1°、查看mysql的依赖
rpm -qa | grep mysql
2°、删除mysql的依赖
rpm -e --nodeps `rpm -qa | grep mysql`
3°、yum安装mysql
yum -y install mysql-server
4°、启动mysql服务
service mysqld start
5°、加入到开机启动项
chkconfig mysqld on
6°、初始化配置mysql服务
whereis mysql_secure_installation
执行脚本/usr/bin/mysql_secure_installation
7°、访问mysql服务
mysql -h node0 -uroot -proot
问题:Host 'node0' is not allowed to connect to this MySQL server
解决办法:
mysql> grant all privileges on *.* to 'root'@'%' identified by '123456';
mysql>grant all privileges on *.* to 'root'@'localhost' identified by '123456' with grant option;
mysql> flush privileges;

 

离线安装Mysql
1°、查看mysql的依赖
rpm -qa | grep mysql
2°、删除mysql的依赖
rpm -e --nodeps `rpm -qa | grep mysql`或者
rpm -e --nodeps `rpm -qa | grep MySQL`
3°、离线安装mysql
rpm -ivh MySQL-server-5.1.73-1.glibc23.x86_64.rpm
rpm -ivh MySQL-client-5.1.73-1.glibc23.x86_64.rpm
4°、启动mysql服务
service mysql start
5°、加入到开机启动项
chkconfig mysql on
6°、初始化配置mysql服务
whereis mysql_secure_installation
执行脚本/usr/bin/mysql_secure_installation
7°、访问mysql服务
mysql -h node0 -uroot -proot
问题:Host 'node0' is not allowed to connect to this MySQL server
解决办法:
mysql> grant all privileges on *.* to 'root'@'%' identified by '123456';
mysql> flush privileges;

posted @ 2016-07-11 23:10  扛着锄头进城  阅读(132)  评论(0编辑  收藏  举报