Created
September 14, 2011 02:03
-
-
Save myusuf3/1215689 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment