how to create mysql user in linux and grant full access , database update

Posted on 2014-08-25
Last Modified: 2014-09-30
Dear Experts:

I am having redhat enterprise linux with mysql server running, I would like to create the mysql user and grant full access to create database, tables , records and do all modifications for whatever this user does, would prefer to do this in linux command level, I have mysql root user credentials

2. How to change the mysql root user password.

3. how to drop the database and import the updated or backup database with the same name, I mean daily backup are taken if any day want to revert to the one day old database would like to drop/delete the running database and import the oneday old data base.

please suggest, thanks in advance.
Question by:D_wathi
    LVL 107

    Expert Comment

    by:Ray Paseur
    I think you would want to start by learning the basics of MySQL.  It has queries to do all of these things.  it's documented in the online man pages.  A good place to start might be here:

    There are many good online learning resources that are well-reviewed, as well as books on the subject.  But as you will see when you start the learning process, there are days, if not weeks, of study required to answer broad questions like these!
    LVL 6

    Assisted Solution

    by:Tim Phillips
    Question 1:
    mysql> CREATE USER 'monty'@'localhost' IDENTIFIED BY 'some_pass';
    mysql> GRANT ALL PRIVILEGES ON *.* TO 'monty'@'localhost' WITH GRANT OPTION;

    Question 2:
    mysql> UPDATE mysql.user SET Password=PASSWORD('MyNewPass') WHERE User='root';

    Question 3: part 1
    mysql> drop database <db_name>

    Question 3: part 2
    mysql> mysqldump -u [username] -p [database_name] > [dumpfilename.sql]

    mysql> mysql -u [username] -p [database_name] < [dumpfilename.sql]
    LVL 61

    Accepted Solution

    # mysql_secure_installation

    Featured Post

    Enabling OSINT in Activity Based Intelligence

    Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

    Join & Write a Comment

    Suggested Solutions

    Little introduction about CP: CP is a command on linux that use to copy files and folder from one location to another location. Example usage of CP as follow: cp /myfoder /pathto/destination/folder/ cp abc.tar.gz /pathto/destination/folder/ab…
    Password hashing is better than message digests or encryption, and you should be using it instead of message digests or encryption.  Find out why and how in this article, which supplements the original article on PHP Client Registration, Login, Logo…
    Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
    Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…

    754 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

    19 Experts available now in Live!

    Get 1:1 Help Now