Mysql: Difference between revisions

From XPUB & Lens-Based wiki
(Created page with "== Create a database + user for a project == <source lang="bash"> sudo su mysql -u root </source> <source lang="mysql"> create database FOO; grant all on FOO.* to FOOUSER@'l...")
 
No edit summary
Line 10: Line 10:
grant all on FOO.* to FOOUSER@'localhost' identified by 'FOOPASS';
grant all on FOO.* to FOOUSER@'localhost' identified by 'FOOPASS';
</source>
</source>
 
NB: localhost means *really* localhost -- it means that only logins are allowed from the same machine and is a *good idea* for most uses.
This creates a database named FOO with user FOOUSER and password FOOPASS;
This creates a database named FOO with user FOOUSER and password FOOPASS;

Revision as of 17:07, 26 June 2019

Create a database + user for a project

sudo su
mysql -u root
create database FOO;
grant all on FOO.* to FOOUSER@'localhost' identified by 'FOOPASS';

NB: localhost means *really* localhost -- it means that only logins are allowed from the same machine and is a *good idea* for most uses. This creates a database named FOO with user FOOUSER and password FOOPASS;