I am trying to install cacti. When I want to import mysql_test_data_timezone.sql to MySQL database on Linux CentOS, I get an error.

My command is

mysql -u root -p mysql < /usr/share/mysql/mysql_test_data_timezone.sql

I get error

No such a file or directory ;

Does this directory have to exist or do I have to create it myself?

  • Is there some reason there is a . at the end of the filename? The command should be mysql -u root -p mysql < /usr/share/mysql/mysql_test_data_timezone.sql. – Nasir Riley May 18 at 21:47
  • No .İ did not write '.' .When I ask question ,I added it by mistake . – Cebrayil May 19 at 4:54

Later versions of CentOS install mariadb-server in preference to mysql server. You can list the files installed by mariadb-server using the rpm utility

rpm -ql mariadb-server

you can then examine the output to see if the file you are looking for is installed (hint: it is, under a different path).

If you do not know which package (if any) provides a particular file you can use yum to search for it e.g.

yum provides /usr/share/mysql/mysql_test_data_timezone.sql

or to search more generally

yum provides */mysql_test_data_timezone.sql
  • Thank you a lot) I provide particular file as you say and works – Cebrayil May 19 at 14:30

Yes, directory /usr/share/mysql should exist with file mysql_test_data_timezone.sql in it. It should have come with with your mysql-server/mariadb-server installation. So I guess your installation is somehow screwed.

  • Now I tried to downloaded mysql again.when I write "yum install mysql mysql-server" .I shows me "mariadb already installed " but It have to show mysql not mariadb .Am I right? – Cebrayil May 19 at 5:08
  • This depends on what you need. As I said, it can be mariadb or mysql, so (re)installing mariadb-server would also be okay. – Freddy May 19 at 9:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.