linux mysql.h 在哪_mysql 在 linux 下的安装

mysql 在 linux 下的安装

1,下载

下载地址:http://dev.mysql.com/downloads/mysql/5.6.html#downloads

下载版本:我这里选择的 5.6.33,通用版,linux 下 64 位

也可以直接复制 64 位的下载地址,通过命令下载:wget http://dev.mysql.com/get/Downloads/MySQL-5.6/mysql-5.6.33-linux-glibc2.5-x86_64.tar.gz

2,解压#解压

tar

-zxvf mysql-5.6.33-linux-glibc2.5-x86_64.

tar

.gz

#复制解压后的mysql目录

cp

-r mysql-5.6.33-linux-glibc2.5-x86_64

/usr/local/mysql

3,添加用户组和用户#添加用户组

groupadd mysql

#添加用户mysql 到用户组mysql

useradd

-g mysql mysql

4,安装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

#修改启动脚本

vi

/etc/init

.d

/mysqld

#修改项:

basedir=

/usr/local/mysql/

datadir=

/usr/local/mysql/data/mysql

#启动服务

service mysqld start

#测试连接

.

/mysql/bin/mysql

-uroot

#加入环境变量,编辑 /etc/profile,这样可以在任何地方用mysql命令了

export

PATH=$PATH:

/usr/local/mysql//bin

source

/etc/profile

#启动mysql

service mysqld start

#关闭mysql

service mysqld stop

#查看运行状态

service mysqld status

5,错误

5.1 sqlyog 连接时,报 1130 错误,是由于没有给远程连接的用户权限问题

解决 1: 更改'mysql'数据库'user'表'host'项,从'localhost'改成'%'.usemysql;

select'host'fromuserwhereuser='root';

update usersethost=' % 'whereuser='root';

flush privileges;

解决 2:直接授权

GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'youpassword' WITH GRANT OPTION;

5.2 安装时的一些错误

-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-devel

6,其他

6.1 配置环境变量vi+/etc/profile

exportPATH=....:/usr/local/mysql/bin

来源: http://www.bubuko.com/infodetail-2468003.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值