How do I change mysql owner from root to something else?

Posted on 2005-04-18
Last Modified: 2011-09-20
I have a db with 88 tables.  Currently, the owner is root.  I need to change this to be another user.  Is there a way I can change all ownership on these tables to be another user?
Question by:foreverdita
    LVL 6

    Expert Comment

    use the chown command.

    type 'man chown' to get the manual pages for chown.
    LVL 10

    Accepted Solution

    use this:
    chown -R "username" /usr/local/mysql/var
    LVL 14

    Expert Comment

    Why would you want to do this?

    Wouldn't it be better to create another user with global permissions to your database. Messing with the root user is not generally a good idea. Just create another user with the same privileges as root.

    If you want to make file system changes, it's better to temporarily give yourself super user permissions by prefixing your commands with su or sudo and entering your password at the prompt. This way, you can behave as root, but don't lose any security.

    Featured Post

    Highfive + Dolby Voice = No More Audio Complaints!

    Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

    Join & Write a Comment

    Loading csv or delimited data files to MySQL database is a very common task frequently questioned about and almost every time LOAD DATA INFILE comes to the rescue. Here we will try to understand some of the very common scenarios for loading data …
    As a database administrator, you may need to audit your table(s) to determine whether the data types are optimal for your real-world data needs.  This Article is intended to be a resource for such a task. Preface The other day, I was involved …
    how to add IIS SMTP to handle application/Scanner relays into office 365.
    In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor ( If you're interested in additional methods for monitoring bandwidt…

    733 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    17 Experts available now in Live!

    Get 1:1 Help Now