p2p.wrox.com Forums

Need to download code?

View our list of code downloads.


Go Back   p2p.wrox.com Forums > PHP/MySQL > BOOK: Beginning PHP, Apache, MySQL Web Development ISBN: 978-0-7645-5744-6
I forgot my password Register Now
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
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 p2p Programmer to Programmer discussion community. This is a community of more than 40,000 computer programmers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining our free Wrox p2p community you can post your own programming questions and respond to other programmers’ questions. Registered users also don't have to see the ads that are displayed to guests. Registration is fast, simple and absolutely free so please, join today!
Join today and post to win prizes! Post more to increase your chances of being Wrox’s top poster of the month.

Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old August 7th, 2007, 02:26 PM
Registered User
 
Join Date: Aug 2007
Location: College Station, TX, USA.
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default 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

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
  #2 (permalink)  
Old October 1st, 2007, 03:47 PM
Registered User
 
Join Date: Oct 2007
Location: , , .
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

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.


Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Possible Error? - CH1 Regiser.php ArthurDent BOOK: PHP and MySQL: Create-Modify-Reuse ISBN: 978-0-470-19242-9 2 August 12th, 2008 03:50 AM
VBA - SQL query returns nothing from MySQL Calligra Access VBA 6 September 19th, 2007 05:10 PM
syntax error on <option selected="selected"> hamid HTML Code Clinic 1 October 13th, 2004 10:20 AM
Page 23, Point 2, Error 1046 carlitio BOOK: Beginning PHP, Apache, MySQL Web Development ISBN: 978-0-7645-5744-6 9 July 9th, 2004 02:52 PM
BookApp returns error serpentierr JSP Basics 1 September 5th, 2003 11:11 PM



All times are GMT -4. The time now is 07:01 AM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
© 2008 Wiley Publishing, Inc