Gostovanje ::: 024. Povezava z MySQL zbirko podatkov

1. Configuration Settings:

Host name = localhost (literally put localhost)
Database name = (cpanelUsername_databaseName)
Database username = (cpanelUsername_databaseUsername)
Database password = (whatever you picked) 

WordPress Example:
User name = joe1337 , Database name = wrdp1 , Database-user name = wp1 , Database-user password = eHTb7%Pxa9

// ** MySQL Settings ** //
/** The name of the database for WordPress */
define('DB_NAME', 'joe1337_wrdp1');

/** MySQL database username */
define('DB_USER', 'joe1337_wp1');

/** MySQL database password */
define('DB_PASSWORD', 'eHTb7%Pxa9');

/** MySQL hostname */
define('DB_HOST', 'localhost');

Note: When you move databases to our servers, the database name and username may change. This change must be updated in your script code. (The database name and username is clearly displayed in cPanel, in the MySQL area.)

On shared servers, the database user name cannot be changed to something without the cPanel user name in it.

It is possible for someone to use their cPanel username and password to connect to the database. However, we NEVER recommend doing this because the first time you change or reset your cPanel password, then your databases will stop working. 

2. How to connect to the MySQL server remotely

Please see our related article on How to Connect to MySQL Remotely. 

IMPORTANT UPDATE ! Since the 11.25 update, we've noticed a bug where you add an IP to the MySQL remote access list, only to find that the corresponding MySQL user that is created does not have any privileges.

In order to get the correct privileges added, you must go back to your MySQL Databases section in cPanel and re-add the user to each database (reassign the privileges). No need to remove the user first; just select the user and the database from the drop-downs and click "Add".

We've notified cPanel about the issue.

  • 221 Users Found This Useful
這篇文章有幫助嗎?

相關文章

Gostovanje ::: 004. cPanel Video podpora

We have set up step-by-step movies on how to do nearly everything with your account. cPanel X3...

Gostovanje ::: 001. Prijava v cPanel

cPanel is used for managing your web hosting account and available on all Linux hosting plans,...

Gostovanje ::: 003. cPanel Priročnik

These are great resources we hope will help: Video Tutorials by cPanelOfficial cPanel User Manual

00. Gostovanje ::: Obvestilo

Članki v tej kategoriji so trenutno na voljo samo v angleškem jeziku. V kolikor imate...

Gostovanje ::: 002. Varna prijava v cPanel

How do I use shared SSL to access cPanel ? Use https and our IP address, followed by the secure...