![]() ![]() If successful, the system displays Query OK. Choose a username that you like.Įnter the following command, replacing username and password with your chosen username and password: CREATE USER IDENTIFIED BY ‘password’ Now that you are logged into MySQL as root, you can create your user. Note: If you have sudo privileges on the server, you can likely find the MySQL root password in the The system prompts you for the root password for MySQL, which is different than your root password for Log in to MySQL as the root user by using the following command: mysql -u root -p ![]() GRANT OPTION: Allows the user to grant or remove other users’ privileges. SHOW DATABASES: Allows the user to list all databases. LOCK TABLES: Allows the user to lock tables. ![]() UPDATE: Allows the user to update table rows. SELECT: Grants the user read-only privileges to the designated databases. INSERT: Allows the user to insert rows into tables. This permission includes all of the following permissionsĬREATE: Allows the user to create new tables or databases.ĭROP: Allows the user to delete tables or databases.ĭELETE: Allows the user to delete rows from tables. The system if you don’t designate a database. PermissionsĬommon permissions include the following:ĪLL PRIVILEGES: Allows the user full access to a designated database or allows global access across Then, create the user again by using the specific IP address. First, create the userīy using the localhost location in the command. The database from the computer you are currently on as well as a specific IP address. For example, suppose you want your user to be able to log in to Locations, you should create the user twice. Note: If you want the user to be able to access the database from two specific locations, and only those For example you could create a user with any of the following commands: If you want the user to log into the database from a specific IP address, insert that ![]() If you want to allow the user to access the database from anywhere, use a % symbol However, using capital letters helps you keep the command syntax separate from the data or variable elementsĪlso, you can change the localhost element, which allows the user to access the database from the computer Both of the following commands work equally well: CREATE USER IDENTIFIED BY ‘password’ You do not have to type MySQL commands in capital letters. Using MySQL commandsįollowing are helpful suggestions for MySQL commands. GRANT SELECT (`User_ID`), SHOW VIEW ON Reports.`Users` to SELECT (`Campaign_ID`), SHOW VIEW ON Reports.`Users` to SELECT (`Created_Date`), SHOW VIEW ON Reports.`Users` to SELECT (`Company`), SHOW VIEW ON Reports.`Users` to SELECT (`City`), SHOW VIEW ON Reports.`Users` to SELECT (`State`), SHOW VIEW ON Reports.`Users` to SELECT (`Zip`), SHOW VIEW ON Reports.`Users` to SELECT (`Phone_Number`), SHOW VIEW ON Reports.`Users` to SELECT (`Credit_Card`), SHOW VIEW ON Reports.`Users` to only the statements for the columns you would like to grant access to and run those queries.The article describes the MySQL® database permissions. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |