Skip to content

MySQL Chuleta.sql

pierregermain edited this page May 3, 2016 · 6 revisions

-- Conectarse con usuario root mysql -u root -p -- Comprobación usuarios use mysql SELECT host, user, password FROM user; -- Show Databases show databases; -- use database use -- show tables show tables; -- show columns; describe -- Anular command (clear) \c select * from users\c -- Print command \p select * from users\p -- Get Help \h -- Create User: CREATE USER 'newuser'@'localhost' IDENTIFIED BY 'password'; GRANT ALL PRIVILEGES ON databaseName . databaseTable TO 'newuser'@'localhost'; GRANT ALL PRIVILEGES ON * . * TO 'newuser'@'localhost'; -- Reload Priv's: FLUSH PRIVILEGES;

Clone this wiki locally