Web Tool Bag  
Home · Articles · Downloads · Discussion Forum · Web Links · News Categories · Synonyms DatabaseMarch 19 2024 03:29:09
Navigation
Home
Articles
Downloads
Discussion Forum
Web Links
News Categories
Synonyms Database
Search
Users Online
Guests Online: 1
No Members Online

Registered Members: 856
Unactivated Members: 118
Newest Member: lakim
Forum Threads
Newest Threads
Error: Cannot find m...
Uncaught Error: _reg...
Module build failed:...
Installation
mochi script questions
Hottest Threads
Installation [12]
Any questions and... [5]
Captcha picture d... [4]
Integrate with Vi... [4]
Mods: Sucess/Than... [4]
 
Latest Articles
Ubuntu: the vpn conn...
Howto Install HP Pri...
ReactJS progress met...
react-show-more-text
react-collapsible-co...
How to create MySql user via terminal in Linux

Login to MySQL

1st you must login to the MySQL server from the terminal with the following command:

mysql -u root -p

In this case is used user root with the -u option, and then used the -p option so in this way MySQL prompts for a password. Please, enter your root user password to complete the login.

You should now be logged in MySQL prompt, this prompt looks very like this:


Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 7251 Server version: 5.5.41-0ubuntu0.14.10.1 (Ubuntu)

Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql>

Create MySQL User

In the following example you will create a user with the name "exampleuser", and the password example123password!

CREATE USER 'exampleuser'@'localhost' IDENTIFIED BY 'example123password!';

Here is it, congratulations! You already are you have created your first MySQL user. However, this user can not do anything with MySQL until are not granted additional privileges. So here you will find how to do this:

Grant permissions

Here is a short list of commonly used permissions :

Allow a user to:
ALL – complete access to a specific database. If a database is not specified, then allow complete access to the entirety of MySQL.
CREATE – create databases and tables.
DELETE – delete rows from a table.
DROP – drop databases and tables.
EXECUTE – execute stored routines.
GRANT OPTION – grant or remove another user’s privileges.
INSERT – insert rows from a table.
SELECT – select data from a database.
SHOW DATABASES - view a list of all databases.
UPDATE – update rows in a table.

GRANT CREATE ON *.* TO 'exampleuser'@'localhost';
GRANT DROP ON tutorial_database.* TO 'exampleuser'@'localhost';
FLUSH PRIVILEGES;

To List/View Grants for MySQL User please, use the following command: SHOW GRANTS FOR 'exampleuser'@'localhost';


Posted by admin on March 20 2015 13:05:41 9856 Reads · Print
Login
Username

Password



Not a member yet?
Click here to register.

Forgotten your password?
Request a new one here.
Member Poll
Which PHP framework do you preffer?

Symfony

Zend

CodeIgniter

PHP on TRAX

eZ Components

Fusebox

PhpOpenbiz

Prado

QPHP

Seagull

You must login to vote.
Shoutbox
You must login to post a message.

Vince
03/10/2011 18:17
Hi, How to remove Register from Login screen? I don't want them to register and have full access! if you leave register then they should not have any rights until the admin assigns them

webtoolz
26/09/2011 08:28
Please describe your problem with more details. Thank you.

bimmer98
22/11/2010 18:31
Help. There was a problem with the request; error regarding feedbackzdr form program

Custom web software development by Devzone Tech
Copyright © 2024 - www.webtoolbag.com