LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices

Reply
 
Search this Thread
Old 11-27-2002, 05:53 AM   #1
ChineseElite
Member
 
Registered: Jun 2002
Posts: 31

Rep: Reputation: 15
MySQL Cannot Access Database


I am trying to set up a forum on my server, Apache, MySQL, PHP and Perl...

THe problem is that it returns the error

MySQL error that was returned: 1046 -> No Database Selected

I have tried to select the database using the 'USE' command in mysql, and it doesn't work.

Any suggestions would be greatly appreciated.
 
Old 11-27-2002, 05:57 AM   #2
esael
Member
 
Registered: Jul 2002
Posts: 109

Rep: Reputation: 15
what steps have you done before?
 
Old 11-27-2002, 07:46 AM   #3
ChineseElite
Member
 
Registered: Jun 2002
Posts: 31

Original Poster
Rep: Reputation: 15
Alright I restart my computer and do the following once logged in:

(apache/mysql are installed in /web/apps/)

$ /web/apps/apache/bin/apachectl start

Apache starts, no errors.

$/web/apps/mysql/share/mysql/mysql.server start

MySQL daemon starts up, no problems.

Nothing doing.
 
Old 11-27-2002, 09:37 AM   #4
Syncrm
Member
 
Registered: Aug 2001
Location: Lansing, Michigan
Distribution: slackware8+
Posts: 472

Rep: Reputation: 30
well, here's how i get mysql started.

root@localhost:~# mysql


that'll start the monitor, and then you'll wanna specifiy which database to use:

mysql> use isp;

then just query a table in the database:

SELECT * FROM table;

that should be about it. if you can't connect you might wanna check and make sure you have a valid root user added to mysql.
 
Old 11-27-2002, 10:06 AM   #5
ChineseElite
Member
 
Registered: Jun 2002
Posts: 31

Original Poster
Rep: Reputation: 15
SELECT * FROM table;

The problem is that no tables are set up yet...
 
Old 11-27-2002, 10:12 AM   #6
ChineseElite
Member
 
Registered: Jun 2002
Posts: 31

Original Poster
Rep: Reputation: 15
Also...

When I try to use phpMyAdmin, the following happens:

mysql> /web/apps/mysql/bin/safe_mysqld: line 273: 1358 Segmentation fault $NOHUP_NICENESS $ledir/$MYSQLD $defaults --basedir=$MY_BASE_DIR_VERSION --datadir=$DATADIR $USER_OPTION --pid-file=$pid_file --skip-locking >>$err_log 2>&1

Number of processes runing now: 1
mysqld process hanging, pid 1361 - killed
021127 09:08:22 mysqld restarted
 
Old 11-27-2002, 10:46 AM   #7
esael
Member
 
Registered: Jul 2002
Posts: 109

Rep: Reputation: 15
Did you create database?

there is also an install_db_mysql.... something like that to create default database for you to use.
 
Old 11-27-2002, 10:51 AM   #8
Syncrm
Member
 
Registered: Aug 2001
Location: Lansing, Michigan
Distribution: slackware8+
Posts: 472

Rep: Reputation: 30
you'll obviously need to create the DB/Table before you can proceed with some of my steps.

you can create a database by typing:

CREATE DATABASE whatever;

use whatever;

CREATE TABLE foobar (
recnum INTEGER NOT NULL PRIMARY KEY AUTO_INCREMENT,
data TEXT,
time DATETIME);

i'd also become at least a little familiar with SQL before using myphpAdmin, since it's always good to have backend knowledge. :-)
 
Old 11-27-2002, 12:36 PM   #9
ChineseElite
Member
 
Registered: Jun 2002
Posts: 31

Original Poster
Rep: Reputation: 15
Yea, I tried it at the recommendation of someone else, but that didnt work either...

I wil lmake the table and see..
 
Old 11-27-2002, 01:04 PM   #10
ChineseElite
Member
 
Registered: Jun 2002
Posts: 31

Original Poster
Rep: Reputation: 15
mysql> CREATE TABLE forums (
-> recnum INTERGER NOT NULL PRIMARY KEY AUTO_INCREMENT,
-> date TEXT,
-> time DATETIME);
ERROR 1064: You have an error in your SQL syntax near 'INTERGER NOT NULL
KEY AUTO_INCREMENT,
date TEXT,
time DATETIME)' at line 2

That is the error I get... I think what I did wrong is try to create a table where you descripbed teh vars... I am not sure.

Also, I tried the mysql.conm docu, but all they described was a table of pets... specifically I am trying to create a database for www.invisionboard.com and www.oxyscripts.com oxynews...
 
Old 11-27-2002, 01:35 PM   #11
jstu
Member
 
Registered: Jan 2002
Distribution: slackware
Posts: 193

Rep: Reputation: 30
You spelled integer wrong
 
Old 11-27-2002, 01:41 PM   #12
bladewalker
Member
 
Registered: Nov 2002
Location: UK
Distribution: Redhat 8
Posts: 30

Rep: Reputation: 15
Also if something is a primary key it cannot be null - you dont need to include the additional not null statement - at least thats the way it normally works - may be different for mySQL
 
Old 11-27-2002, 07:02 PM   #13
ChineseElite
Member
 
Registered: Jun 2002
Posts: 31

Original Poster
Rep: Reputation: 15
Quote:
Originally posted by jstu
You spelled integer wrong
I spelled it the same way you did...

blade: thanks.. I will look into it ASAP (one of my 2 moniters died, and now I dont have aserver moniter).
 
Old 11-27-2002, 08:30 PM   #14
DavidPhillips
Guru
 
Registered: Jun 2001
Location: South Alabama
Distribution: Fedora / RedHat / SuSE
Posts: 7,154

Rep: Reputation: 56
it's INTEGER not INTERGER


LOL

 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Writing an app that uses a mysql database without installing mysql server? QtCoder Programming 4 08-09-2004 02:43 PM
MYSQL help - mysql database missing eloviyandhi Linux - Software 1 03-20-2004 09:20 PM
Restoring MYSQL database without SSH shell access hct224 Linux - Newbie 5 01-08-2004 06:14 AM
MySQL on RedHat 9 GUI, can't access database linuxquestionsu Linux - Software 0 10-09-2003 02:44 PM
Mysql database from cd JHuizingh Linux - Software 0 02-22-2003 02:08 PM


All times are GMT -5. The time now is 05:33 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration