Guest User

Untitled

a guest
Jan 22nd, 2018
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.72 KB | None | 0 0
  1. # connect as root to the MySQL server
  2. # all this is saying connect as user 'root' with password i am going to provide.
  3. # you will be prompted for password after you press enter.
  4. mysql -u root -p
  5.  
  6. # Once you are connected you will be presented with the following prompt
  7. mysql>
  8.  
  9. # if you want to learn type in
  10. mysql> /h
  11.  
  12. # otherwise do the following to create a username and password and table.
  13.  
  14. # create database
  15. CREATE DATABASE testdb;
  16. # create user 'testuser' which can only connect from localhost with password 'changeme'
  17. CREATE USER 'testuser'@localhost IDENTIFIED BY 'changeme';
  18. # you give it permission to create and edit all table in the testdb
  19. GRANT ALL PRIVILEGES ON testdb.* TO 'testuser'@localhost;
  20. # you exit mysql
  21. exit
Add Comment
Please, Sign In to add comment