巫师的蜕变

导航

 

1.将安装包放在服务器上:
mysql-5.6.37-linux-glibc2.12-x86_64.tar.gz

2.将安装包解压:
tar -zxvf mysql-5.6.37-linux-glibc2.12-x86_64.tar.gz

3.将解压的文件复制到指定的文件夹下:
mkdir /home/mysql/
mv ./mysql-5.6.33-linux-glibc2.12-x86_64/* /home/mysql/

4.添加用户组
groupadd mysql
添加用户mysql 到用户组mysql
useradd -g mysql mysql

5.安装
cd /usr/local/mysql/
mkdir ./data/mysql
chown -R mysql:mysql ./
./scripts/mysql_install_db --user=mysql --datadir=/usr/local/mysql/data/mysql
cp support-files/mysql.server /etc/init.d/mysqld
chmod 755 /etc/init.d/mysqld
cp support-files/my-default.cnf /etc/my.cnf

6.修改启动脚本
vi /etc/init.d/mysqld
修改项:
basedir=/usr/local/mysql/
datadir=/usr/local/mysql/data/mysql

7.启动服务
service mysqld start

8.测试连接
./mysql/bin/mysql -uroot

9.加入环境变量,编辑 /etc/profile,这样可以在任何地方用mysql命令了
export PATH=$PATH:/usr/local/mysql//bin
source /etc/profile

10.其他问题
修改mysql的连接用户名和密码
更改 ‘mysql’数据库‘user’表‘host’项,从‘localhost’改成‘%’。

-bash: ./scripts/mysql_install_db: /usr/bin/perl: bad interpreter: 没有那个文件或目录
解决: yum -y install perl perl-devel

Installing MySQL system tables..../bin/mysqld: error while loading shared libraries: libaio.so.1: cannot open shared object file: No such file or directory
解决:yum -y install libaio-deve

配置环境变量
vi + /etc/profile
export PATH=....:/usr/local/mysql/bin

posted on 2017-12-26 17:46  jacunjpg  阅读(5009)  评论(0编辑  收藏  举报