码迷,mamicode.com
首页 > 数据库 > 详细

mysql安装使用

时间:2016-07-12 00:01:51      阅读:190      评论:0      收藏:0      [点我收藏+]

标签:

在线安装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;

mysql安装使用

标签:

原文地址:http://www.cnblogs.com/zlzhoulei/p/5661997.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!