Archive forDatabases

mysql stuff

just for our support staff’s Memo:

step I: start mysql in safe mode with commands:
killall mysqld
/usr/libexec/mysqld –skip-grant-tables –user=root &
step II:
on safe mode, you can access mysql without password with commands
mysql mysql
mysql> update user set password=PASSWORD(’newpassword’) where user=’root’;
mysql>flush privileges;
mysql>quit;
step III: start mysql in normal mode:
killall mysqld
/etc/rc.d/init.d/mysqld start

step IV: create new db
mysql -p

mysql>create database yabba_dabba;
mysql>quit;

step V: import data into the new db
mysql yabba_dabba < /root/yabba_dabba.mysql.dmp

Comments