Creating users and databases. To create a MySQL database and user, follow these steps: At the command line, log in to MySQL as the root user: mysql -u root -p.