免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
楼主: sophia_wang99
打印 上一主题 下一主题

linux下mysl的错误,大家帮忙看看 [复制链接]

论坛徽章:
0
31 [报告]
发表于 2011-09-01 15:37 |只看该作者
本帖最后由 sophia_wang99 于 2011-09-01 15:44 编辑

回复 30# chenyx


第一步: service mysqld stop
第二步: killal -TERM mysqld
第三步: mysql_install_db --user=mysql(执行完该命令后,显示信息如下:)
  1. # mysql_install_db --user=mysql
  2. Installing MySQL system tables...
  3. 110901 15:43:55 [Warning] option 'max_join_size': unsigned value 18446744073709551615 adjusted to 4294967295
  4. 110901 15:43:55 [Warning] option 'max_join_size': unsigned value 18446744073709551615 adjusted to 4294967295
  5. OK
  6. Filling help tables...
  7. 110901 15:43:55 [Warning] option 'max_join_size': unsigned value 18446744073709551615 adjusted to 4294967295
  8. 110901 15:43:55 [Warning] option 'max_join_size': unsigned value 18446744073709551615 adjusted to 4294967295
  9. OK

  10. To start mysqld at boot time you have to copy
  11. support-files/mysql.server to the right place for your system

  12. PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !
  13. To do so, start the server, then issue the following commands:
  14. /usr/bin/mysqladmin -u root password 'new-password'
  15. /usr/bin/mysqladmin -u root -h localhost.localdomain password 'new-password'

  16. Alternatively you can run:
  17. /usr/bin/mysql_secure_installation

  18. which will also give you the option of removing the test
  19. databases and anonymous user created by default.  This is
  20. strongly recommended for production servers.

  21. See the manual for more instructions.

  22. You can start the MySQL daemon with:
  23. cd /usr ; /usr/bin/mysqld_safe &

  24. You can test the MySQL daemon with mysql-test-run.pl
  25. cd mysql-test ; perl mysql-test-run.pl

  26. Please report any problems with the /usr/bin/mysqlbug script!

  27. The latest information about MySQL is available on the web at
  28. http://www.mysql.com
  29. Support MySQL by buying support/licenses at http://shop.mysql.com
复制代码
第四步: /usr/bin/mysqladmin -u root password '111111'(提示如下信息)
  1. [root@localhost mysql]# /usr/bin/mysqladmin: connect to server at 'localhost' failed
  2. error: 'Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)'
  3. Check that mysqld is running and that the socket: '/var/lib/mysql/mysql.sock' exists!
复制代码

论坛徽章:
381
CU十二周年纪念徽章
日期:2014-01-04 22:46:58CU大牛徽章
日期:2013-03-13 15:32:35CU大牛徽章
日期:2013-03-13 15:38:15CU大牛徽章
日期:2013-03-13 15:38:52CU大牛徽章
日期:2013-03-14 14:08:55CU大牛徽章
日期:2013-04-17 11:17:19CU大牛徽章
日期:2013-04-17 11:17:32CU大牛徽章
日期:2013-04-17 11:17:37CU大牛徽章
日期:2013-04-17 11:17:42CU大牛徽章
日期:2013-04-17 11:17:47CU大牛徽章
日期:2013-04-17 11:17:52CU大牛徽章
日期:2013-04-17 11:17:56
32 [报告]
发表于 2011-09-01 15:42 |只看该作者
mysql服务没起来吗?重启下mysql服务看看.

论坛徽章:
0
33 [报告]
发表于 2011-09-01 15:46 |只看该作者
本帖最后由 sophia_wang99 于 2011-09-01 15:49 编辑

回复 32# chenyx


    服务启动后提示

[root@localhost bin]# service mysqld start
Starting MySQL:  [  OK  ]

[root@localhost bin]# mysqladmin -u root password '111111'
mysqladmin: connect to server at 'localhost' failed
error: 'Access denied for user 'root'@'localhost' (using password: NO)'


在这种状态下,再用mysql -u root -p (使用空密码就出错了,进不去了),提示:
[root@localhost bin]# mysql -u root -p
Enter password:
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)
[root@localhost bin]#

论坛徽章:
381
CU十二周年纪念徽章
日期:2014-01-04 22:46:58CU大牛徽章
日期:2013-03-13 15:32:35CU大牛徽章
日期:2013-03-13 15:38:15CU大牛徽章
日期:2013-03-13 15:38:52CU大牛徽章
日期:2013-03-14 14:08:55CU大牛徽章
日期:2013-04-17 11:17:19CU大牛徽章
日期:2013-04-17 11:17:32CU大牛徽章
日期:2013-04-17 11:17:37CU大牛徽章
日期:2013-04-17 11:17:42CU大牛徽章
日期:2013-04-17 11:17:47CU大牛徽章
日期:2013-04-17 11:17:52CU大牛徽章
日期:2013-04-17 11:17:56
34 [报告]
发表于 2011-09-01 15:48 |只看该作者
lz刚才不是说mysql直接就可以进入了吗,应该没有密码了.
现在你输入mysql,看看能直接进入不

论坛徽章:
0
35 [报告]
发表于 2011-09-01 15:50 |只看该作者
本帖最后由 sophia_wang99 于 2011-09-01 15:53 编辑
lz刚才不是说mysql直接就可以进入了吗,应该没有密码了.
现在你输入mysql,看看能直接进入不
chenyx 发表于 2011-09-01 15:48



    [root@localhost bin]# mysql -u root -p
Enter password:
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)
[root@localhost bin]# mysql
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)
[root@localhost bin]#


在这种情况下用mysql_install_db --user=mysql
貌似也不好使了,{:3_201:}

用mysql -u root -p(空密码) 和mysql都无法进入了

论坛徽章:
0
36 [报告]
发表于 2011-09-01 17:07 |只看该作者
回复 35# sophia_wang99


    用最原始的办法解决了:

   第一步: 将所有mysql mv
  1. mv /usr/shared/mysql /usr/shared/mysql-bk
  2. mv /var/lib/mysql /var/lib/mysql-bk
  3. mv /usr/lib/mysql /usr/lib/mysql-bk
复制代码
第二步:卸载、重新安装所有mysql相关的软件
  1. rpm -e  --nodeps mysql-5.0.22-2.1.0.1
  2. rpm -e --nodeps myslq-server-5.0.22-2.1.0.1
  3. yum -y install mysql mysql-server php-mysql php-pear php-mbstring
复制代码
通过以上方法之后就可以成功改动mysql的root密码了

接下来再做其他事情了,非常感谢大家的帮忙,对于mysql第一次接触给了各下马威

论坛徽章:
0
37 [报告]
发表于 2011-09-04 22:08 |只看该作者
正常安装后,建立数据库,用mysqladmin设置root用户密码,然后启动mysqld_safe --user=root &启动,终端登陆就没问题啊,
怎么你就这么悲剧阿。

论坛徽章:
0
38 [报告]
发表于 2011-09-04 23:20 |只看该作者
root用户在mysql里面没有权限啊。

论坛徽章:
0
39 [报告]
发表于 2011-09-04 23:55 |只看该作者
dsd

论坛徽章:
0
40 [报告]
发表于 2011-09-05 17:59 |只看该作者
用df -i看看,你的innode是不是使用完了,估计是这个原因!
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP