Skip to content

Instantly share code, notes, and snippets.

@laozhu
Created October 8, 2012 03:24
Show Gist options
  • Save laozhu/3850560 to your computer and use it in GitHub Desktop.
Save laozhu/3850560 to your computer and use it in GitHub Desktop.
install mysql
emerge -av mysql
eix-installed all | grep mysql
> dev-db/mysql-5.1.62-r1
emerge --config =dev-db/mysql-5.1.62-r1
# 加入开机启动项
rc-update add mysql default
/etc/init.d/mysql restart
rc-status
# 重置ROOT密码
/etc/init.d/mysqld stop
mysqld_safe --skip-grant-tables &
mysql -u root
mysql> use mysql;
mysql> update user set password=PASSWORD("newrootpassword") where user='root';
mysql> flush privileges;
mysql> quit
/etc/init.d/mysql start
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment