1

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?

6
  • Post your command that give this error Commented Jan 17, 2016 at 10:42
  • C:\Program Files (x86)\MySQL\MySQL Server 5.6\bin>mysql ERROR 2003 (HY000): Can't connect to MySQL server on 'localhost' (10061) Commented Jan 17, 2016 at 10:45
  • sorry, the commandline where your start mysql like mysql -u xxxx -h yyyyy. It looks that you are not connected to the server. can you do any other command at the mysql promt - SHOW DATABASES; Commented Jan 17, 2016 at 10:47
  • Oh !!! previously on hitting 'show databases' it displays me databases but I think now I lost connection to server how to connect now Commented Jan 17, 2016 at 10:52
  • I started MySQL using 'services.msc' but now on hitting command "create database ivs" it again gives me error 1044 Commented Jan 17, 2016 at 10:54

2 Answers 2

3

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
Sign up to request clarification or add additional context in comments.

Comments

0

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'

1 Comment

Mark bernd buffen answer as the correct answer to help others.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.