To connect to your MySQL server, type or paste in the following command in a Terminal or Command Prompt and press Enter.
mysql -u root -p
Enter your MySQL server's root password and press Enter. If you don't remember the password it can be reset with the mysqladmin command.
Once connected to the MySQL server you should see a mysql> prompt waiting for your commands.
To create a new Onpub database, type or paste in the following command.
CREATE DATABASE onpub CHARACTER SET=latin1 COLLATE=latin1_general_ci;
MySQL should say Query OK if the command above was successful. You should now have a database called onpub to store your Onpub-generated content in.
You will now create a new MySQL user account. Onpub will use these credentials to connect to the database when it needs to save or edit your content. This new user's access will be restricted to the database created above.
Run the following command while still at the mysql> command prompt. Be sure to replace the 'user' part below with a user name of your own choice. Also, be sure to replace the 'password' part below with a password of your own choice.
GRANT ALL ON onpub.* TO 'user'@'localhost' IDENTIFIED BY 'password';
MySQL should say Query OK if the command above was successful. Type Ctrl+C (Windows) or Ctrl+D (Linux and OS X) to quit the mysql command prompt.
You now have a MySQL database and user account you can use to login to Onpub.
Feel free to comment on this article below. Any abusive/offensive material will be removed without notice.
blog comments powered by Disqus