Hi All,
I am new to mySQL and I have 2 questions:
1. Everytime I login to mySQL:
machine 21:06:32 ~ $ mysql -u root -p
Enter password:
It asks me for password. Since I didn't set a password for root when I
installed mySQL, I can just hit Enter and I will be login. This seems
silly so is there a way to disable the prompt so I am automatically
login without hitting Enter?
2. I want to create a user account with only SELECT privilege from
everywhere (like from other hosts). How can I do that? Will the
following work:
GRANT SELECT PRIVILEGES ON mydb.* TO 'readonly'@'*' IDENTIFIED by
'password'
Do I need to create the 'readonly' user first? Or will the above
automatically create the 'readonly' user if it does not already
exists?
Thanks!
I am new to mySQL and I have 2 questions:
1. Everytime I login to mySQL:
machine 21:06:32 ~ $ mysql -u root -p
Enter password:
It asks me for password. Since I didn't set a password for root when I
installed mySQL, I can just hit Enter and I will be login. This seems
silly so is there a way to disable the prompt so I am automatically
login without hitting Enter?
2. I want to create a user account with only SELECT privilege from
everywhere (like from other hosts). How can I do that? Will the
following work:
GRANT SELECT PRIVILEGES ON mydb.* TO 'readonly'@'*' IDENTIFIED by
'password'
Do I need to create the 'readonly' user first? Or will the above
automatically create the 'readonly' user if it does not already
exists?
Thanks!
Comment