Question

i have following problem, I messed around with the mysql files without really understand what they are good for. Basically I deleted the databases and the my.cnf. Writing a new my.cnf isn't a problem but I can't restore the databases especially the schema's. Without them I can't start mysql. I already tried yum -reinstall mysql but that didn't seem to restore those files at all. Can you help me with this problem please?

I am using Fedora 19.

Was it helpful?

Solution

First, recreate your my.cnf. You'll probably want to at least ensure it's got the following contents:

[mysqld]
datadir=/var/lib/mysql
user=mysql

For a more sensible set of defaults, use the one that comes with the distribution, or find a file called my-default.cnf if you're running a recent version. You might have other .cnf files to look at for inspiration.

Then, find the mysql_install_db script with locate mysql_install_db and run it like this (as root):

/path/to/mysql_install_db --user=mysql

That will set up a basic default installation with the necessary system databases.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top