tags:

views:

56

answers:

2

I have started mysql on my test server as a root. I have added

user=root

line in my.cnf Since I want the test server to upgrade to production server, I will like to comment this line and restart.

Are there any side effects? data loss expected?

+1  A: 

The 'root' user for MySQL is NOT the same as the root user for logging in to the computer, so there should be no side effects provided you GRANT the appropriate rights to the mysql user on the production server.

That is the user mentioned in

$ mysql -u user -p password db_name

which could share a name with a user logged in to the computer, but doesn't have to.

EDIT: note - an ordinary user can start mysql as root if the correct password is used in the command above. This won't be the same as root's password, if you know what I mean.

If it's not clear you should definitely familiarise yourself with the meaning of 'root' in a MySQL context.

pavium
shantanuo is talking about the user in linux that mysql runs as, not the users in mysql.
longneck
yes, that's why I pointed out that the user in mysql is not the same thing. linux user permissions and mysql grants aren't the same thing.
pavium
+1  A: 

first step would be to back up your data directory.

after you've done that, go ahead and make the change. just make sure that you have a user named mysql (or specify a different one explicitly) and that they have appropriate permissions to the data directory.

this is a pretty safe operation to do and should result in no loss of functionality or data. but just in case, you do have the backup!

longneck
There are a few files those show root:root as owner instead of usual mysql:mysql I have two questions...1) How do I recursively change the ownership to mysql of mysql data directory?2) Why does certain sock) files refuse to change it's ownership from root?
shantanuo
i don't know how to change ownership. i'm a windows guy.
longneck
chown -R mysql:mysql /path/to/mysql/root
James McNellis