LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 06-27-2004, 07:37 AM   #1
linux_child001
LQ Newbie
 
Registered: Jun 2004
Posts: 9

Rep: Reputation: 0
Mysql table creation problems!!


hi I tried to create a table in my sql by executing the following query.


CREATE TABLE product
(
prodID INT UNSIGNED AUTO_INCREMENT,
description VARCHAR(100),
PRIMARY KEY(prodID)
);

But it is not working, The error is


ERROR 3: Error writing file './test/product.frm' (Errcode: 28)

Help Me I am Very New to Mysql

Thanks.......

 
Old 06-27-2004, 07:52 AM   #2
david_ross
Moderator
 
Registered: Mar 2003
Location: Scotland
Distribution: Slackware, RedHat, Debian
Posts: 12,047

Rep: Reputation: 79
Check the permissions on the mysql data directory - does the user that mysql is running as have write access to it?
 
Old 06-27-2004, 07:55 AM   #3
linux_child001
LQ Newbie
 
Registered: Jun 2004
Posts: 9

Original Poster
Rep: Reputation: 0
I am able to delete existing tables.It means that i have the writing permissions??
 
Old 06-27-2004, 08:11 AM   #4
Mara
Moderator
 
Registered: Feb 2002
Location: Grenoble
Distribution: Debian
Posts: 9,696

Rep: Reputation: 232Reputation: 232Reputation: 232
No, it's not the same. You need to check the permissions, I think. I don't know how you have your MySQL installed, but look into /var/lib/mysql, it may be the right directory.
 
Old 06-27-2004, 08:15 AM   #5
linux_child001
LQ Newbie
 
Registered: Jun 2004
Posts: 9

Original Poster
Rep: Reputation: 0
I am entering from the root account,and i used mysql -h sr2 -u root tes for entering into mysql, and i dont have a password,is there any wrong with that??

Thanks for ur valuable reply
 
Old 06-27-2004, 08:31 AM   #6
linux_child001
LQ Newbie
 
Registered: Jun 2004
Posts: 9

Original Poster
Rep: Reputation: 0
I also set the /var/lib/mysql and its contents to 777 .,yet it is not working
 
Old 06-27-2004, 08:35 AM   #7
david_ross
Moderator
 
Registered: Mar 2003
Location: Scotland
Distribution: Slackware, RedHat, Debian
Posts: 12,047

Rep: Reputation: 79
Can you post the output from:
ls -la /var/lib/mysql
ps -ef | grep mysql
df -h

Last edited by david_ross; 06-27-2004 at 08:37 AM.
 
Old 06-27-2004, 09:06 AM   #8
linux_child001
LQ Newbie
 
Registered: Jun 2004
Posts: 9

Original Poster
Rep: Reputation: 0
ls -la /var/lib/mysql output is

total 16
4 drwxrwxrwx 2 mysql mysql 4096 Jun 27 19:05 mysql
4 drwxrwxrwx 2 mysql mysql 4096 Jun 27 18:26 project
4 drwxrwxrwx 2 mysql mysql 4096 Jun 27 19:19 test
4 -rwxrwxrwx 1 mysql mysql 763 Jun 27 19:22 valuestoadd


ps -ef | grep mysql


root 1082 1 0 19:16 tty1 00:00:00 /bin/sh /usr/bin/safe_mysqld --d
mysql 1109 1082 0 19:16 tty1 00:00:00 /usr/libexec/mysqld --defaults-f

df -h

Filesystem Size Used Avail Use% Mounted on
/dev/hda13 5.3G 5.2G 0 100% /
/dev/hda3 76M 17M 55M 24% /boot
/dev/hda12 7.9G 6.0G 1.6G 79% /home
none 109M 0 108M 0% /dev/shm

I think the problem is with space .
But i can create text files on /
 
Old 06-27-2004, 09:18 AM   #9
david_ross
Moderator
 
Registered: Mar 2003
Location: Scotland
Distribution: Slackware, RedHat, Debian
Posts: 12,047

Rep: Reputation: 79
It is a space issue. You can probably create files as root but not as a regular or system user like mysql. I suggest that you free ups some space on /. Perhaps you could move your databases to /home/mysql/data - that will give you more space for them and free up space on the / partition
 
Old 06-28-2004, 08:30 AM   #10
linux_child001
LQ Newbie
 
Registered: Jun 2004
Posts: 9

Original Poster
Rep: Reputation: 0
Thank you sir that is the problem.Then how can i change the directory(By just moving??),
how i inform mysql that the directory is changed?
Thank you
 
Old 06-28-2004, 01:10 PM   #11
david_ross
Moderator
 
Registered: Mar 2003
Location: Scotland
Distribution: Slackware, RedHat, Debian
Posts: 12,047

Rep: Reputation: 79
The best way is to:
1) Stop mysqld
2) Move the data to it's new location - ie "/home/mysql/data"
3) Change the options when you start mysqld to use "--datadir=/home/mysql/data"
4) Start mysqld
 
  


Reply



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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
CREATE TABLE problems in MySQL mosdef Linux - Software 0 03-10-2004 10:18 AM
MySQL non-realtime table-by-table mirroring Passive Linux - Software 1 01-20-2004 12:11 PM
How to import MS ACCESS Table including OLE filed into the MySQL Table ? myunicom Linux - General 1 11-28-2003 11:30 AM
mysql database creation zuessh Linux - Software 17 05-14-2003 01:13 PM
deleted mysql table in mysql now cant do anything nakkaya Linux - Software 0 03-18-2003 06:03 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 02:39 AM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration