mysq privileges

mysql assign privileges to users.

install mysql-workbench under ubuntu

#sudo apt-get update

#sudo apt-get install mysql-workbench

#mysql-workbench

#mysql -u root -p

mysql>select host,user,password from mysql.user;

mysql>show grants for 'root'@'localhost';

mysql>grant all on sakila.* to 'zhj'@'%';

mysql>create user 'hive'@'%' identified by 'hive123';

mysql>grant all privileges on *.* to 'hive'@'%';

mysql permits local access defaultly. To enable remote access, you should change /etc/mysql/my.cnf

bind_address = ::

then restart mysql server

#sudo service mysql restart

-----centos

mysql removiing and reinstall process;

Step 1: Uninstall existing rpms using yum

# yum remove mysql mysql-server

Step 2: Remove or move /var/lib/mysql folder.

# mv /var/lib/mysql /var/lib/mysql-bak

Step 3: Reinstall mysql again using yum.

# yum install mysql mysql-server

Step 4: Now mysql service will start successfully.

  

service mysqld start

猜你喜欢

转载自ylzhj02.iteye.com/blog/2033481