6

mysql安装步骤(2)直接安装

 3 years ago
source link: https://wakzz.cn/2017/09/29/mysql/%E5%AE%89%E8%A3%85%E6%AD%A5%E9%AA%A4(2)%E7%9B%B4%E6%8E%A5%E5%AE%89%E8%A3%85/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

mysql安装步骤(2)直接安装

祈雨的博客
2017-09-29

一、准备文件

mysql-5.6.36-linux-glibc2.5-x86_64.tar.gz
官网下载链接

$ tar mysql-5.6.36-linux-glibc2.5-x86_64.tar.gz

三、MySQL安装

1、进入mysql的安装路径

$ cd mysql-5.6.36-linux-glibc2.5-x86_64/
$ mkdir datadir

2、复制默认配置文件

$ cp support-files/my-default.cnf ./my.cnf

3、修改配置文件my.cnf

basedir = /home/sun_zeming/mysql/mysql-5.6.36-linux-glibc2.5-x86_64
datadir = /home/sun_zeming/mysql/mysql-5.6.36-linux-glibc2.5-x86_64/datadir
port = 6660
# server_id = .....
socket = /home/sun_zeming/mysql/mysql-5.6.36-linux-glibc2.5-x86_64/mysql.sock

4、安装mysql

$ ./scripts/mysql_install_db --user=root --defaults-file=/home/sun_zeming/mysql/mysql-5.6.36-linux-glibc2.5-x86_64/my.cnf

四、启动MySQL

$ ./bin/mysqld --defaults-file=/home/sun_zeming/mysql/mysql-5.6.36-linux-glibc2.5-x86_64/my.cnf

五、MySQL授权

1、设置root用户密码

$ ./bin/mysqladmin –h127.0.0.1 –P6660 -u root password "123456"

2、登录mysql

$ ./bin/mysql –h127.0.0.1 -P6660 -uroot -p123456
mysql> grant all privileges on *.* to 'root'@'%' identified by '123456' with grant option;

Recommend

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK