LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   MySQL Cannot Access Database (https://www.linuxquestions.org/questions/linux-general-1/mysql-cannot-access-database-36598/)

ChineseElite 11-27-2002 05:53 AM

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.

esael 11-27-2002 05:57 AM

what steps have you done before?

ChineseElite 11-27-2002 07:46 AM

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.

Syncrm 11-27-2002 09:37 AM

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.

ChineseElite 11-27-2002 10:06 AM

SELECT * FROM table;

The problem is that no tables are set up yet...

ChineseElite 11-27-2002 10:12 AM

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

esael 11-27-2002 10:46 AM

Did you create database?

there is also an install_db_mysql.... something like that to create default database for you to use.

Syncrm 11-27-2002 10:51 AM

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. :-)

ChineseElite 11-27-2002 12:36 PM

Yea, I tried it at the recommendation of someone else, but that didnt work either...

I wil lmake the table and see..

ChineseElite 11-27-2002 01:04 PM

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...

jstu 11-27-2002 01:35 PM

You spelled integer wrong

bladewalker 11-27-2002 01:41 PM

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

ChineseElite 11-27-2002 07:02 PM

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).

DavidPhillips 11-27-2002 08:30 PM

it's INTEGER not INTERGER


LOL

:D :D


All times are GMT -5. The time now is 06:10 AM.