PDA

View Full Version : Problem with creating database schema


dakkonz
24-11-2005, 07:45
hi guys,
can anyone help me?
I trying to insert the database schema and the intial data values into the database....

from the manual i am suppose to run
cat schema.sql \mysql -u <username> -p <password> zabbix

for my case... once logged in as my user acct
I run
cat zabbix-1.0/create/mysql/schema.sql /usr/local/mysql/bin/mysql -u <username> zabbix

But the schema does not get into the databases

I have already granted all privileges to Mysql username and there is no password for Mysql login
The way i connect to mysql is 1) once logged in I will key
cd /usr/local/mysql/bin
then i will type
./mysql -u <username>
to enter to sql....

Think there is something wrong with my path for sql connection... can anyone help me solve this???

Thanks

krusty
24-11-2005, 12:11
Hi, do something like that:

cat zabbix-1.0/create/mysql/schema.sql |mysql -u <username> zabbix
or if you have set password
cat zabbix-1.0/create/mysql/schema.sql |mysql -u <username> -p<password> zabbix

This works fine.

Greez

dakkonz
24-11-2005, 12:34
Erm it still cant work.
I got the error
-bash: mysql: command not found

krusty
24-11-2005, 13:08
enter the console the following command

which mysql

now you know the path to mysql.

What happens if you type into the console mysql -u <user> -p <password> zabbix
Can you enter mysql?

krusty
24-11-2005, 13:09
which distribution or better which os you use?

dakkonz
24-11-2005, 13:44
[weekiat@samba ~]$ which mysql
/usr/bin/which: no mysql in (/usr/kerberos/bin:/usr/local/bin:/bin:/usr/bin:/usr/X11R6/bin:/home/weekiat/bin)

this is wat i got from keying in which mysql

krusty
24-11-2005, 14:09
[weekiat@samba ~]$ which mysql
/usr/bin/which: no mysql in (/usr/kerberos/bin:/usr/local/bin:/bin:/usr/bin:/usr/X11R6/bin:/home/weekiat/bin)

this is wat i got from keying in which mysql

ok, i think your installation of mysql was wrong. do you install mysql with os? If you install mysql after os do you use rpm or src Code for installation? Which os do you use?
Maybe you can link mysql manual. Let me look.

Landstalker
24-11-2005, 14:12
mysql is not in your path so you can't just execute it.

do find -name mysql and it should present you with where its installed to. Probably something like /usr/local/bin/ or something like that.

Then where it says |mysql in the above command, just insert the full location just after the pipe ( | ).

Try that.

krusty
24-11-2005, 14:14
cat zabbix-1.0/create/mysql/schema.sql |/usr/local/mysql/bin/mysql -u <username> zabbix

ok, maybe this works

try it

dakkonz
24-11-2005, 14:49
hmm tried it... but it seems not all tables are created...
only slightly more than half.....shall go and check what is wrong with the MYSQL code at that point

Thanks a lot guys.....
Great Help

:)

krusty
24-11-2005, 15:07
you should have 42 tables in zabbix database. :D

dakkonz
25-11-2005, 04:01
hmmm i only got the following in the database
| actions |
| alarms |
| alerts |
| config |
| functions |
| graphs |
| graphs_items |
| groups |
| history |
| history_str |
| hosts |
| hosts_groups |
| items |
| media |
| media_type |
| services |
| services_links |
| sessions |
| sysmaps |
| sysmaps_hosts |
| sysmaps_links |
| trigger_depends |
| triggers |
| users |

and i have counted the tables in the schema.sql it only adds up to 33 tables
I am using the zabbix-1.0 stable version

dakkonz
25-11-2005, 04:29
I manage to create the database already... but it only contains 33 tables.
There appears to be a problem in the schema.sql file
CREATE TABLE rights (
rightid int(4) NOT NULL auto_increment,
userid int(4) DEFAULT '0' NOT NULL,
name char(255) DEFAULT '' NOT NULL,
permission char(1) DEFAULT '' NOT NULL,
id int(4),
PRIMARY KEY (rightid)
) type=InnoDB;

I added in the 0 for the userid default value and my schema.sql gets added in into mysql without any error.

dakkonz
25-11-2005, 07:39
I have proceeded in the installation till run server process
but i got an error when trying to run suckerd and trapperd

./zabbix_suckerd: error while loading shared libraries: libmysqlclient.so.15: cannot open shared object file: No such file or directory

can anyone guide me how to solve this?
Thanks

krusty
25-11-2005, 16:30
I manage to create the database already... but it only contains 33 tables.
There appears to be a problem in the schema.sql file
CREATE TABLE rights (
rightid int(4) NOT NULL auto_increment,
userid int(4) DEFAULT '0' NOT NULL,
name char(255) DEFAULT '' NOT NULL,
permission char(1) DEFAULT '' NOT NULL,
id int(4),
PRIMARY KEY (rightid)
) type=InnoDB;

I added in the 0 for the userid default value and my schema.sql gets added in into mysql without any error.

Ok, I use the 1.1beta and I had 42 tables. Maybe the stable version has only 33 Tables. I donīt know. I never installed the stable version. :D