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, 2020 in Database by akhtar
• 38,230 points
2,906 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, 2020 by MD
• 95,320 points

Related Questions In Database

0 votes
3 answers

MySQL "Could not create connection to database serve" error

Pls check that you have MySQL server ...READ MORE

answered Jul 3, 2020 in Database by anonymous
22,613 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,120 points
518 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
612 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
465 views
0 votes
1 answer

Can't connect to mysql server in workbench. Kindly please support. username: root & Password: 1234 (i gave)

Hey, @Arivukani, You can see once thing, the solution ...READ MORE

answered Mar 30, 2020 in Database by Gitika
• 65,970 points
585 views
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,170 points
231 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
176 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,170 points
1,610 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,170 points
327 views