The following command will create a new user and grant them all the permissions on a database. Grant all privileges on databasename. to 'username'@'localhost' identified by 'securepassword'; To list the permissions granted to a user show grants for 'username'@'localhost'. To provide All privileges to an user from a specific server your Grant commands can be like the one below. GRANT ALL PRIVILEGES ON databasename TO 'user'@'hostname' IDENTIFIED BY PASSWORD password; FLUSH PRIVILEGES; To provide select and execute grants to your user.
Grant All Privileges On Owncloud.* To 'username'@'localhost' Identified By 'password'
Syntax mysql CREATE USER ' username'@'localhost' IDENTIFIED BY ' password';mysql GRANT ALL ON dbname.table TO ' username'@'localhost';ImplementationFirst login to mysql with root account and use following command to create new user ‘ rahul in mysql with Full privileges. But this user can access database server from localhost only. Mysql CREATE USER ' rahul'@'localhost' IDENTIFIED BY ' password';mysql GRANT ALL ON. TO ' rahul'@'localhost' IDENTIFIED BY ' secretpassword';mysql FLUSH PRIVILEGES;Now, try to login using new password # mysql -u rahul -p' password'Welcome to the MySQL monitor. Commands end with; or g.Your MySQL connection id is 9522Server version: 5.5.30-cll MySQL Community Server (GPL) by AtomicorpCopyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.Oracle is a registered trademark of Oracle Corporation and/or itsaffiliates. Other names may be trademarks of their respectiveowners.Type 'help;' or 'h' for help.
Type 'c' to clear the current input statement.mysql. I am trying this section, but when i put in the first GRANT ALL ON command, it goes to a subsection, which i believe is an input request. I have no idea what it wants, ive tried password and username but nope. It looks likeMariaDB (None) GRANT ALL ON owncloud. to ‘owncloud’@’localhost’ IDENTIFIED BY ‘SecretPassword’- //this is blank, but if i type here, it just keeps it an makes a new line, like this-Im guessing this is a simple case of not knowing Ubuntu very well, or something similar. Sorry, for the time 🙂.