What are my database name and host name?

If you are using a PHP or Perl script that connects to a MySQL database, you may need to specify your database name and database host name.

Database Name

When you initially set up your MySQL account, a database named mysql is created. Please do not use the database name mysql for your scripts, as this database is used to administrate your MySQL database environment. We strongly recommend creating new databases to use with your custom and third-party scripts.

How to create a database.

Host Name

Your database host name is always mysql.

Important: Many scripts will use the default host name localhost. Please be aware that when using third-party scripts, you will need to change the host name from localhost to mysql, or your scripts will not function.

To learn more about MySQL, please visit the MySQL web site or browse books about MySQL.

  • Was this article helpful?

  • Yes
  • No

Still need help?