Home >Database >Mysql Tutorial >在Redhat中装配Mysql

在Redhat中装配Mysql

WBOY
WBOYOriginal
2016-06-07 16:14:581199browse

在Redhat中安装Mysql 安装时请使用root用户。安装前准备两个rpm包: MySQL-server-5.6.12-1.el6.x86_64.rpm MySQL-client-5.6.12-1.el6.x86_64.rpm 1、安装服务端: 命令:rpm -ivh MySQL-server-5.6.12-1.el6.x86_64.rpm 2、安装客户端 命令:rpm -ivh MySQL

在Redhat中安装Mysql

安装时请使用root用户。安装前准备两个rpm包:

MySQL-server-5.6.12-1.el6.x86_64.rpm

MySQL-client-5.6.12-1.el6.x86_64.rpm

1、安装服务端:

命令:rpm -ivh MySQL-server-5.6.12-1.el6.x86_64.rpm

2、安装客户端

命令:rpm -ivh MySQL-client-5.6.12-1.el6.x86_64.rpm

3、在Redhat中是不能使用空密码登录mysql的,请依次执行以下命令:

su root
?????? service mysql stop
?????? mysqld_safe --user=mysql --skip-grant-tables --skip-networking &
?????? mysql -u root mysql
?????? UPDATE user SET Password=PASSWORD('123456') where USER='root';
?????? FLUSH PRIVILEGES;
?????? quit
?????? exit
?????? ln -s /var/lib/mysql/mysql.sock /tmp/mysql.sock
?????? service mysql start
??? 执行完毕后,再次登录

mysql -uroot -p123456

4、登录后执行mysql命令时,还会提示设置密码,再次运行以下命令:

SET Password=PASSWORD('123456')

?

?

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn