Open main menu

CDOT Wiki β

Changes

OPS345 Lab 4

151 bytes added, 01:13, 5 January 2022
Some basic SQL
3 rows in set (0.00 sec)
</source>
 
The mysql '''dbroot''' user is not the same as the '''root''' user on the Linux machine that's running MariaDB. But it is the administrator of the entire database server, and therefor has access to all the data in all the tables, in all the databases. You should only user the root user for creating other users, creating and deleting databases, and for assigning permissions.
 
 
<source></source>
<source></source>
* use mysql; show tables; select * from user; select user from user;
* mysql root is not the same as the linux root, but it is an administrator and you should only use it for creating users, databases, and assigning permissions.
* Typically you would use something like this: " MariaDB> grant all privileges on DATABASE_NAME.* TO 'USER_NAME'@'%' identified by 'PASSWORD'; " but that won't work on AWS RDS because your root user doesn't have ALL PRIVILEGES, so can't grant them to another user.
* Instead create a user first: CREATE USER 'andrewdb'@'%' IDENTIFIED BY 'andrewdbpassword';