search
Categories
Sponsors
VirtualMetric Hyper-V Monitoring, Hyper-V Reporting
Archive
Blogroll

Badges
MCSE
Community

Cozumpark Bilisim Portali
How to create MySQL database and user via command line?
Posted in Linux Server | No Comment | 2,160 views | 27/12/2011 09:33

You can create MySQL database and user via command line.

1
2
3
4
CREATE DATABASE dbname;
CREATE USER 'dbusername'@'localhost';
SET PASSWORD FOR 'dbusername'@'localhost' = PASSWORD('PASSWORD');
GRANT SELECT,INSERT,UPDATE,DELETE,CREATE,DROP,INDEX,ALTER,CREATE TEMPORARY TABLES,LOCK TABLES,REFERENCES ON dbname.* TO `dbusername`@`localhost` WITH GRANT OPTION;

That gives only localhost grant on MySQL server.



Leave a Reply