 |
BOOK: Beginning PHP, Apache, MySQL Web Development ISBN: 978-0-7645-5744-6  | This is the forum to discuss the Wrox book Beginning PHP, Apache, MySQLWeb Development by Michael K. Glass, Yann Le Scouarnec, Elizabeth Naramore, Gary Mailer, Jeremy Stolz, Jason Gerner; ISBN: 9780764557446 |
|
Welcome to the p2p.wrox.com Forums.
You are currently viewing the BOOK: Beginning PHP, Apache, MySQL Web Development ISBN: 978-0-7645-5744-6 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
|
|
|

August 7th, 2007, 01:26 PM
|
Registered User
|
|
Join Date: Aug 2007
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Ch1 MySQL returns Error 1046: No database selected
I'm working on configuring mysql and mostly everything but one issue I'm having with is that many of my commands will return the Error 1046: No database selected.
Here is an example of code
C:\>mysql -u root -p
Enter password: ********
Welcome to the MySQL monitor..
..
..
mysql>show tables;
ERROR 1046 (3D000): No database selected
mysql>SELECT user, host FROM user;
ERROR 1046 (3D000): No database selected
mysql>show databases;
*---------*
Database
----------
information_schema
mysql
test
--------
3 rows...
------------
As you can see I've got mysql installed and everything, and PHP works with mysql, but I don't know where this error message is coming from. What can I do to fix this? Keep in mind that I don't have an extensive background with setting up networks. Thanks
|

October 1st, 2007, 02:47 PM
|
Registered User
|
|
Join Date: Oct 2007
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
in order to show anything you have to select the data base. try "use test" after that you can see what is in it. to see what users you have in your data base, first change to the mysql database. "use mysql" then type "select user, host, password from user;" that will show you the info you want in the second command.
|
|
 |