Showing posts with label mysql. Show all posts
Showing posts with label mysql. Show all posts

Wednesday, December 28, 2011

mysql reset root password

http://www.cyberciti.biz/tips/recover-mysql-root-password.html

on fedora: /etc/init.d/mysqld
on debian: /etc/initd/mysql

/etc/init.d/mysql stop
mysqld_safe --skip-grant-tables &
mysql -u root 
mysql> use mysql;
mysql> update user set password=PASSWORD("NEW-ROOT-PASSWORD") where User='root';
mysql> flush privileges;
mysql> quit
/etc/init.d/mysql start

Monday, November 21, 2011

mysql testdb


mysql> create database testdb;
Query OK, 1 row affected (0.03 sec)

mysql> create user 'testuser'@'localhost' identified by 'password';
Query OK, 0 rows affected (0.06 sec)

mysql> use testdb;
Database changed
mysql> grant all on testdb.* to 'testdb'@'localhost';
Query OK, 0 rows affected (0.00 sec)

mysql>flush privileges

mysql>select user, host from mysql.user;

Sunday, October 23, 2011

mysqladmin

mysqladmin cmd 


mysql -u uid -p blah_db <blah.sql