Warning: mysql_select_db() [function.mysql-select-db]: Access denied for user 'ODBC'@'localhost' (using password: NO) in C:\xampp\htdocs\include\connect_inc.php on line 6
Aimee, this error message is telling you that your script
connect_inc.php has not been configured with the database credentials needed to access the MySQL database and so you are presented with this default error message.
All the other error messages are a follow on from the first error.
The database access details that usually need to be entered normally consist of these four items:
- Code: Select all
define('DB_NAME', 'wordpress'); // The name of the database
define('DB_USER', 'wp'); // The user name for this database
define('DB_PASSWORD', 'pw'); // ...and the user's password
define('DB_HOST', 'localhost'); // 99% chance you won't need to change this value
Your code may appear different than the above WordPress wp-config.php or the place that you would type in these details may appear different but the script configuration requires these 4 details before it can proceed to function.
To create a database in phpMyAdmin and so have these items available to enter in your connect_inc.php file or some other included configuration file it uses to get the details, try and follow the how to below.
(
I have tried to make it flow and easy to follow so please let me know if you have any issues with it.).
This example relates to WordPress, the blog, but you can easily adapt the instructions and insert your own details that your script needs where applicable.
Or let me know which script you are trying to install, commercial or open source it doesn't matter which as more than likely I have installed it at some time or another.
I could then possibly give you specific related instructions for your particular script.
Most of the instructions needed for creating a database for your script may be contained within your script's installation instructions.
If we use the info I supplied in the wp-config.php file - in the above code snippet - as an example then we create a database "
wordpress", a user "
wp" with a password "
pw" on host "
localhost" with "
all privileges" to only use this "
wordpress" database, like so:
Create A DatabaseGo into phpMyAdmin from the XAMPP welcome Page
http://localhostFind the Tools menu
Click on
phpMyAdmin:
or go direct to phpMyAdmin using this URI
http://localhost/phpmyadminIn phpMyAdmin
In the text box "Create New Database" type
wordpressclick on
CreateIn the left hand frame find the
Home icon near the top and click on it.
You will return to the first screen we just typed "wordpress" in.
In the left frame you should see "
wordpress (0)".
The wordpress database is now created.
Create UserClick on
PrivilegesClick on
Add a new UserFill in the blanks
User name:
wpHost: Select
Local from the drop box
Password:
pwRe-type:
pwClick on
Go (bottom right)
Click on the
Home icon in the left frame again.
This will put you back to the home page once again.
We now have a user
wp with a password
pw.
Now we have to give the user
wp privileges to our
wordpress database only.
Give User Database PrivilegesClick on
PrivilegesIn the list, find your
wp user and click on the
Edit Privileges icon at far right of the name.
Find the box "
Database-specific privileges".
Select the
wordpress database in the drop box
Add privileges on the following database:In the next screen that is displayed after selecting the
wordpress database
Click on
Database-specific privileges
( Check All )Click on
GoClick on the
Home icon in the left frame once again to return you to the phpMyAdmin home page.
We now have a database on
localhost called
wordpress with a user
wp who has a password of
pw with
all privileges to use that database only.
To Check All Is CorrectClick on the database
wordpress (0) in the left frame.
Click on the
Privileges button in the top menu.
Check that you have the following in the
Users having access to "wordpress" table.
- Code: Select all
User Host Type Privileges Grant
wp localhost database-specific ALL PRIVILEGES Yes
Thats it and you are set to go and complete your script (
in this example the Wordpress script) installation.
You can use the above method to create any database with any username with any password for any script you want in the future, so keep a copy of this procedure handy for reference.
This how-to may save you some time, also it may possibly help with your learning curve for XAMPP.
Good luck!
===========================================1. The new
DeskTopXampp Launch Control for
XAMPP / XAMPPlitePosted by
Ridgewood available from Ridgewood's
DTX web site 2. Build Rich
AJAX Applications - Faster
TIBCO General Interface Pro Edition but
FREE and
Open SourceFully working with
NO donations required to get a user/password
===========================================[/code]