1

I have been granted root privileges to a server for a class project. I need to create mysql databases and users. I without tracking down the right people at the university do not have mysql root privileges though. Is this possible without resetting the mysql root password?

server distro fedora mysql version 5.5

thx in advance

arcane
  • 13
  • 3
  • Wait, you *do* or you *do not* have root access? You contradict yourself in your question. – EEAA Jan 30 '14 at 20:49
  • 1
    I have system (su root) privileges which is different from mysql root. No contradiction. – arcane Jan 30 '14 at 21:00

3 Answers3

1

I don't think there's any way to set up mysql users from system root without clobbering the existing mysql root user (unless you happen to have a fully-privileged mysql user that doesn't happen to be root.) Some database engines (like Oracle) recognize a particular system user as a DBA user, but to the best of my knowledge MySQL doesn't do that.

If you can find the right person at the university who has the mysql root info, that'll be the simplest way.

Another option would be to set up a separate instance of mysql running off a different data directory, and start with a clean set of user permissions.

Or, as a long shot, poke around in root's home directory for a .my.cnf file that has the mysql root credentials stuffed in it.

  • This confirmed what I thought. Poked around like suggested but no luck. I'll just hunt down the sys admin. – arcane Jan 30 '14 at 20:58
1

mysqld has an option called '--skip-grant-tables'. When enabled, it makes mysql skip any password or privilege check, accepting any user/password combination as mysql root until restarted.

user47093
  • 111
  • 2
0

If you can safely restart the mysql server, you have two options:

  • What user47093 suggested, disabling authentication checks temporarily
  • Using an init-file, but instead of the UPDATE statement that page has you do, use the init-file to run a GRANT
ThisGuy
  • 101
  • 1