简体   繁体   中英

How to create mysql database using command prompt? I'm getting error ERROR 1044 (42000): Access denied for user ''@'localhost' to database 'ivs'

I want to create database in mysql I installed MySQL 5.6 in windows 8, During installation installer never asked me username or password. When I'm executing command " create database ivs; " it gives me following error:

ERROR 1044 (42000): Access denied for user ''@'localhost' to database 'ivs' what can I do now?

You have use the default User and not root . The default User dosent have enough right to Create Databases. Start the Client with root User

c:> mysql -uroot

After great discussion with @Bernd Buffen I got solution for my problem, when I use 'create database ivs' I actually not logged in with 'root' user (I'm logged in with guest user) so to change this to root I use following command:

C:\\Program Files (x86)\\MySQL\\MySQL Server 5.6\\bin>mysql -uroot and then I use

 mysql> create database ivs; to create database named 'ivs'

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM