当前位置:Gxlcms > 数据库问题 > linux下安装Mysql

linux下安装Mysql

时间:2021-07-01 10:21:17 帮助过:3人阅读

-5.6.33-linux-glibc2.5-x86_64.tar.gz

    4、添加系统mysql组和mysql用户

1 groupadd mysql
2 useradd -r -g mysql mysql

    5、修改当前目录拥有者为mysql用户

 chown -R mysql:mysql ./

    6、安装数据库,此处可能出现错误。

./scripts/mysql_install_db --user=mysql

错误信息:./scripts/mysql_install_db: /usr/bin/perl: bad interpreter: No such file or directory

原因:没有/usr/bin/perl文件或者档案。

解决办法:(安装perl跟perl-devel即可)

yum -y install perl perl-devel

错误信息:FATAL ERROR: please install the following Perl modules before executing ./scripts/mysql_install_db:

Data::Dumper

 解决方法 :安装autoconf库,此包安装时会安装Data:Dumper模块

yum -y install autoconf

    7、修改当前目录拥有者为root用户

chown -R root:root ./

    8、修改当前data目录拥有者为mysql用户

chown -R mysql:mysql data

============== 到此数据库安装完毕 =============

   9、启动mysql服务和添加开机启动mysql服务

添加开机启动,把启动脚本放到开机初始化目录。

cp support-files/mysql.server /etc/init.d/mysql

    10、启动mysql服务

service mysql start

错误信息:

/etc/init.d/mysql: line 256: my_print_defaults: command not found
/etc/init.d/mysql: line 276: cd: /usr/local/mysql: No such file or directory
Starting MySQL ERROR! Couldn‘t find MySQL server (/usr/local/mysql/bin/mysqld_safe)

==========

 

 

/usr/local/mysql-5.6.33-linux-glibc2.5-x86_64

 

 

---恢复内容结束---

linux下安装Mysql

标签:

人气教程排行