liunx mysql 安装

来源:互联网 发布:英语小说阅读软件 编辑:程序博客网 时间:2024/06/03 18:38

1、准备文件

-rwxrwxrwx. 1 root root 17713894 Sep 24 01:52     MySQL-client-5.5.38-1.linux2.6.x86_64.rpm
-rwxrwxrwx. 1 root root 50535068 Sep 24 01:52     MySQL-server-5.5.38-1.linux2.6.x86_64.rpm

mysql 服务文件及客户端文件

 

2、检查和卸载已有mysql

请见另一篇文章。。。


3、安装

环境都准备好以后,手下安装mysql服务

[root@localhost mysql]# rpm -ivh MySQL-server-5.5.38-1.linux2.6.x86_64.rpm
Preparing...                ########################################### [100%]
   1:MySQL-server           ########################################### [100%]

PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !
To do so, start the server, then issue the following commands:

/usr/bin/mysqladmin -u root password 'new-password'
/usr/bin/mysqladmin -u root -h localhost password 'new-password'

Alternatively you can run:
/usr/bin/mysql_secure_installation

which will also give you the option of removing the test
databases and anonymous user created by default.  This is
strongly recommended for production servers.

See the manual for more instructions.

然后安装mysql客户端

[root@localhost mysql]# rpm -ivh MySQL-client-5.5.38-1.linux2.6.x86_64.rpm
Preparing...                ########################################### [100%]
   1:MySQL-client           ########################################### [100%]


设置初始root 密码

[root@localhost mysql]# /usr/bin/mysqladmin -u root password '123456'


安装成功。


4、设置mysql访问权限

mysql> grant all privileges on *.* to root@'%' identified by '123456';

设置并刷新

mysql> flush privileges;



0 0
原创粉丝点击