ERROR 1006 (HY000): Can't create database 'test' (errno: 2) in mysql

0 votes

Hi Guys,

I installed mysql in my system. But whenever I tried to create one database, I got this below error. 

ERROR 1006 (HY000): Can't create database 'test' (errno: 2)

How can I solve this problem?

Apr 14 in Database by akhtar
• 10,580 points
112 views

1 answer to this question.

0 votes

Hi@akhtar,

You have to change the permissions or ownership of your MySQL data directory. Likely, the data directory is owned by root but the MySQL process is running under the user mysql.
To find out where your data directory is located, use the bellow command.

$ mysqladmin variables | grep datadir 
$ chown -R mysql:mysql /var/lib/mysql

That's assuming that your MySQL process is running as the user mysql.

answered Apr 14 by MD
• 23,050 points

Related Questions In Database

0 votes
2 answers

MySQL "Could not create connection to database serve" error

When I am trying to connect netbeans ...READ MORE

answered Apr 14, 2019 in Database by anonymous

edited Apr 15, 2019 by Kalgi 8,217 views
0 votes
2 answers
0 votes
1 answer

How can I check my all existing table in MySQL database?

Hi Pratik, I understand your problem regarding this ...READ MORE

answered Jul 1, 2019 in Database by sampriti
• 1,100 points
114 views
0 votes
1 answer

How to load data of .csv file in MySQL Database Table?

At first, put the dataset in the ...READ MORE

answered Jul 5, 2019 in Database by Reshma
355 views
0 votes
1 answer

showing an error in a MySQL trigger

use this code: CREATE TRIGGER sample_trigger_msg ...READ MORE

answered Sep 27, 2019 in Database by Omaiz
• 560 points
74 views
0 votes
1 answer
0 votes
1 answer

Update hdfs data before stroring in MySql

Yes, you can update the data before ...READ MORE

answered Jan 27, 2019 in Big Data Hadoop by Omkar
• 69,060 points
71 views
0 votes
1 answer

Using Hadoop for Data Analytics.

Yes, your approach is correct - you ...READ MORE

answered Sep 28, 2018 in Big Data Hadoop by Frankie
• 9,810 points
65 views
0 votes
1 answer

How to open MySql console in Ubuntu?

sudo service mysqld restart mysql -u <username> root ...READ MORE

answered Dec 14, 2018 in Big Data Hadoop by Omkar
• 69,060 points
374 views
–1 vote
1 answer

Facing the below error while installing mysql in VM

We would like to say that the ...READ MORE

answered Dec 21, 2018 in Big Data Hadoop by Omkar
• 69,060 points
122 views