MySQL: Difference between revisions

640 bytes added ,  20 September 2017
add Change of DB users
add Change of DB users
Line 1: Line 1:
<!--__FORCETOC__-->
<!--__FORCETOC__-->
== Removing access from users ==
Show all grants for a user.
<source lang="mysql">
mysql> show grants for 'webuser'@'localhost';
</source>
Show a list of users for db, tables, columns, or processes.
<source lang="mysql">
mysql> use mysql;
mysql> select user,host from db where db='db_name';
mysql> select user,host from tables_priv where db='table_name';
mysql> select user,host from columns_priv where db='columns_name';
mysql> select user,host from procs_priv where db='procs_name';
</source>
Revoke all privilege from a database.
<source lang="mysql">
mysql> revoke all privileges on dbcloud.* from 'dbacc'@'localhost';
</source>


== Setting up a Replication (Master-Slave) ==
== Setting up a Replication (Master-Slave) ==