User Tools

Site Tools


info:mysql:user:create
Please note, that this is an old archived version of this site. Check out the new version at andunix.net!

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
info:mysql:user:create [2015-09-24 19:18]
andunix
info:mysql:user:create [2016-01-25 11:49] (current)
andunix
Line 25: Line 25:
 CREATE DATABASE IF NOT EXISTS `{db}`; CREATE DATABASE IF NOT EXISTS `{db}`;
  
-GRANT ALL PRIVILEGES ON '{db}. *  TO '{user}'@'%';+GRANT ALL PRIVILEGES ON `{db}. *  TO '{user}'@'%'; 
 +</code> 
 + 
 +Simpler Alternative: 
 + 
 +<code sql> 
 +CREATE DATABASE IF NOT EXISTS `dbname` DEFAULT CHARACTER SET = 'utf8'; 
 +GRANT ALL ON `dbname`.* TO 'dbuser'@'dbhost' IDENTIFIED BY 'dbpass';
 </code> </code>
  
 {{tag>admin database mysql sql}} {{tag>admin database mysql sql}}
info/mysql/user/create.1443122325.txt.gz · Last modified: 2015-09-24 19:18 by andunix