您现在的位置: 万盛学电脑网 >> 程序编程 >> 数据库 >> mysql教程 >> 正文

让mysql在gentoo上跑起来

作者:佚名    责任编辑:admin    更新时间:2022-06-22

  在 gentoo 上安装了 mysql, 但运行时总是的得到这个错误信息:

  Access denied for user 'root'@'localhost'

  可以这样解决:

  # /etc/init.d/mysql stop

  # mysqld_safe --user=mysql --skip-grant-tables --skip-networking &

  # mysql -u root mysql

  mysql> UPDATE user SET Password=PASSWORD('yournewpasswd') where USER='root';

  mysql> FLUSH PRIVILEGES;

  mysql> quit

  # /etc/init.d/mysql restart

  搞定。

  测试一下:

  $ mysqladmin -uroot -pmypasswd ping

  mysqld is alive

  运行:

  $ mysql -uroot -p

  Enter password:

  Welcome to the MySQL monitor. Commands end with ; or g.

  Your MySQL connection id is 6

  Server version: 5.0.44-log Gentoo Linux mysql-5.0.44

  Type 'help;' or 'h' for help. Type 'c' to clear the buffer.

  mysql>