linux如何安装mysql菜鸟_linux下源码安装mysql遇到困难了。菜鸟在线等答,跪谢!!!!!...

linux版本:CentOS_5.2mysql版本:mysql-5.1.34.tar.gz(源码安装包)我参照安装文档(INSTALL-SOURCE),操作步骤如下:1>groupaddmysql2>useradd-gmysqlmysql3>tar-zxvfmysql-5.1.34.tar.g...

linux版本 :CentOS_5.2 mysql版本 :mysql-5.1.34.tar.gz (源码安装包) 我参照安装文档(INSTALL-SOURCE),操作步骤如下: 1 > groupadd mysql 2 > useradd -g mysql mysql 3 > tar -zxvf mysql-5.1.34.tar.gz 4 > cd mysql-5.1.34 5 > ./configure --prefix=/opt/lamp/mysql5 6 > make 7 > make install 8 > cp support-files/my-medium.cnf /etc/my.cnf 9 > cd /opt/lamp/mysql5 10 > chown -R mysql . 11 > chgrp -R mysql . 12 > bin/mysql_install_db --user=mysql 13 > chown -R root . 14 > chown -R mysql var 15 > bin/mysqld_safe --user=mysql & ======================================================================== 每次执行到上面第12不的时候总是报错,错误信息如下: [root@localhost mysql5]# bin/mysql_install_db --user=mysql Installing MySQL system tables... 090511 17:34:55 [ERROR] /opt/lamp/mysql5/libexec/mysqld: unknown option '--skip-federated' 090511 17:34:55 [ERROR] Aborting 090511 17:34:55 [Note] /opt/lamp/mysql5/libexec/mysqld: Shutdown complete Installation of system tables failed! Examine the logs in /opt/lamp/mysql5/var for more information. You can try to start the mysqld daemon with: shell> /opt/lamp/mysql5/libexec/mysqld --skip-grant & and use the command line tool /opt/lamp/mysql5/bin/mysql to connect to the mysql database and look at the grant tables: shell> /opt/lamp/mysql5/bin/mysql -u root mysql mysql> show tables Try 'mysqld --help' if you have problems with paths. Using --log gives you a log in /opt/lamp/mysql5/var that may be helpful. The latest information about MySQL is available on the web at http://www.mysql.com/. Please consult the MySQL manual section 'Problems running mysql_install_db', and the manual section that describes problems on your OS. Another information source are the MySQL email archives available at http://lists.mysql.com/. Please check all of the above before mailing us! And remember, if you do mail us, you MUST use the /opt/lamp/mysql5/bin/mysqlbug script! ============================================================== 我对12步骤的错误信息不理解,不知道到底哪里做错了,然后继续按照安装文档执行下面的安装。。。 最后报出的错误信息如下: [root@localhost mysql5]# bin/mysqld_safe --user=mysql & [1] 21884 [root@localhost mysql5]# 090511 17:38:40 mysqld_safe Logging to '/opt/lamp/mysql5/var/localhost.err'. 090511 17:38:40 mysqld_safe Starting mysqld daemon with databases from /opt/lamp/mysql5/var 090511 17:38:40 mysqld_safe mysqld from pid file /opt/lamp/mysql5/var/localhost.pid ended [1]+ Done bin/mysqld_safe --user=mysql ++++++++++++++++++++++++++++++ 新手,刚刚自学linux,对于我的安装过程网上也找了很久,实在不得其解,希望前辈们帮帮我。 小弟我不胜感激。。先谢了

展开

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
好的,下面是详解mysql8.0.18在linux安装与配置过程: 1. 下载MySQL 8.0.18的安装包 可以在MySQL的官网上下载MySQL 8.0.18的安装包,下载地址为:https://dev.mysql.com/downloads/mysql/8.0.html#downloads 2. 解压安装包 下载完成后,将安装包解压到指定目录中,使用以下命令: tar zxvf mysql-8.0.18-linux-glibc2.12-x86_64.tar.gz -C /usr/local 3. 创建MySQL用户和组 创建MySQL用户和组,使用以下命令: groupadd mysql useradd -r -g mysql -s /bin/false mysql 4. 安装MySQL 切换到MySQL所在的目录,使用以下命令安装MySQL: cd /usr/local/mysql-8.0.18-linux-glibc2.12-x86_64 ./bin/mysqld --initialize --user=mysql --basedir=/usr/local/mysql-8.0.18-linux-glibc2.12-x86_64/ --datadir=/usr/local/mysql-8.0.18-linux-glibc2.12-x86_64/data 5. 启动MySQL 启动MySQL,使用以下命令: ./bin/mysqld_safe --user=mysql & 6. 设置MySQL密码 MySQL启动后,需要设置MySQL的root用户的密码,使用以下命令: ./bin/mysql_secure_installation 7. 配置MySQL 进入MySQL的配置文件my.cnf,使用以下命令: cd /etc vi my.cnf 将以下内容加入到my.cnf中: [mysql] default-character-set=utf8mb4 [mysqld] port = 3306 datadir = /usr/local/mysql-8.0.18-linux-glibc2.12-x86_64/data socket = /tmp/mysql.sock default-time-zone = '+8:00' character-set-server = utf8mb4 collation-server = utf8mb4_unicode_ci 8. 重启MySQL 修改完my.cnf后,重启MySQL,使用以下命令: systemctl restart mysqld 9. 登录MySQL 使用以下命令登录MySQL: ./bin/mysql -u root -p 至此,MySQL 8.0.18在linux安装与配置完成。

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值