Create database syntax mysql

  When creating the app database, you need to set the owner.

First, create the database.

mysql> create database appname;

then create the  user who will have write permissions:

mysql> create user 'appname'@'localhost' identified with mysql_native_password by 'somepassword';

mysql> flush privileges;

If you forget the password, you can change it again like so:

mysql> alter user 'appname'@'localhost' identified with mysql_native_password by 'somepassword';

If you are using mysql version 8 or later, you need "with mysql_native_password" otherwise wordpress doesn't authenticate the database owner. At least, that was still true at the time of writing this.

If you are using mysql version 5 or below, you can skip that. 

Comments

Popular posts from this blog

what to do if you crashed your database OR it says there are no tables (but there are!)

Permanently save login password for mysql client