Creating a MySQL user and database
When we first installed MySQL on our development machine, it created a root user who can manage the database system. This user has complete access to the MySQL server, including all databases and tables.
Furthermore, beginning with MySQL v5.7, the root user can be authenticated via the auth socket plugin rather than a username and password, as allowed by the MySQL client used with TypeORM.
Important Note
The name of the system user that launches the MySQL client and the MySQL user must be the same when using the auth socket plugin; moreover, you must execute mysql with sudo privileges to have access to your database(s).
For the reasons stated above, it is required to create a new user in MySQL and provide it with the right permissions. To do so, go through the following steps:
- To begin, use the following command to connect to MySQL:
sudo mysql
You'll be asked to enter a password. Enter your system's root password...