Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # connect as root to the MySQL server
- # all this is saying connect as user 'root' with password i am going to provide.
- # you will be prompted for password after you press enter.
- mysql -u root -p
- # Once you are connected you will be presented with the following prompt
- mysql>
- # if you want to learn type in
- mysql> /h
- # otherwise do the following to create a username and password and table.
- # create database
- CREATE DATABASE testdb;
- # create user 'testuser' which can only connect from localhost with password 'changeme'
- CREATE USER 'testuser'@localhost IDENTIFIED BY 'changeme';
- # you give it permission to create and edit all table in the testdb
- GRANT ALL PRIVILEGES ON testdb.* TO 'testuser'@localhost;
- # you exit mysql
- exit
Add Comment
Please, Sign In to add comment