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. |
what steps have you done before?
|
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. |
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. |
SELECT * FROM table;
The problem is that no tables are set up yet... |
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 |
Did you create database?
there is also an install_db_mysql.... something like that to create default database for you to use. |
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. :-) |
Yea, I tried it at the recommendation of someone else, but that didnt work either...
I wil lmake the table and see.. |
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... |
You spelled integer wrong
|
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
|
Quote:
blade: thanks.. I will look into it ASAP (one of my 2 moniters died, and now I dont have aserver moniter). |
it's INTEGER not INTERGER
LOL :D :D |
All times are GMT -5. The time now is 06:10 AM. |