Các lệnh cơ bản
mysql star: $ service mysqld start
mysql stop:$ service mysqld stop
mysql restart:$ service mysqld restart
mysql stop:$ service mysqld stop
mysql restart:$ service mysqld restart
import file mysql: $mysql -uroot -proot
login:$mysql -u root -proot
nho rang moi cau lenh sau mysql> deu phai co ";"
show databases : mysql> show databases;
drop database: mysql>drop database client5;
Thêm use trong mysql
mysql>CREATE USER 'tenUser'@'localhost' IDENTIFIED BY 'pass';
mysql>CREATE USER 'tenUser'@'localhost' IDENTIFIED BY 'pass';
mysql>GRANT EXECUTE, PROCESS, SELECT, SHOW DATABASES, SHOW VIEW, ALTER, ALTER ROUTINE, CREATE, CREATE ROUTINE, CREATE TABLESPACE, CREATE TEMPORARY TABLES, CREATE VIEW, DELETE, DROP, EVENT, INDEX, INSERT, REFERENCES, TRIGGER, UPDATE, CREATE USER, FILE, LOCK TABLES, RELOAD, REPLICATION CLIENT, REPLICATION SLAVE, SHUTDOWN, SUPER ON *.* TO 'tenUser'@'localhost' WITH GRANT OPTION;
mysql>FLUSH PRIVILEGES;
No comments:
Post a Comment