last year i created a dynamic site with php mysql.
i connected to database through below code
$conn=mysql_connect("localhost","hosting_username","hosting_password") or die(mysql_error());
now i m planning to create wordpress blog and would like to know whether i should enter same “hosting_username” and “hosting_password” in the “wp-config” file for database username and password.
/** The name of the database for WordPress */
/** MySQL database username */
/** MySQL database password */
/** MySQL hostname */
will it work fine or i have to create separate user for wordpress db.
whats the purpose of creating separate user.
hosting username and password is just to control hosting management not mysql.
You must create mysql user with all privileges to specific database.
Finally specific that mysql username and password in wp-config.php
will i be able to access phpmyadmin with that username and password directly without going to cpanel ?
phpMyAdmin which is part of cpanel then you can’t access directly, compulsory it requires authenticated.
if you need to access your database directly without going to cpanel, then you need to use one page database management tool - Adminer
phpMyAdmin is not actually part of cPanel. phpMyAdmin is a database management tool…Most hosts configure it to work seamlessly with cPanel or whatever they use. If you allow that user to access all databases you will be fine.
If you are using a cPanel webhost (I would suspect other control panels offer similar functionality) then you need to log into your cPanel, and click the MySQL Database link. You need to create a MySQL database. Then you need to create a MySQL username and assign it a password. Don’t use the same password as your cPanel password, pick something different and unique. Then you need to assign this MySQL user, to the MySQL database that you created, giving it the appropriate permissions.
Then in your wp-config.php file, replace the relevant data.
DB_NAME refers to the MySQL database you created.
DB_USER refers to the MySQL username you created.
DB_PASSWORD refers to the password for the MySQL username you created.
DB_HOST would very likely remain as localhost
Yes it will work (I do exactly that for my sites). There is no reason for creating a separate user unless you are going to set up each user with access to only the specific tables it needs access to.
and a database user is different than a wordpress user. You will rarely, if ever, need to touch the actual database for wp…
How can i set permission for user to access only single specific table and not the whole database.