LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 04-08-2011, 08:45 AM   #1
Glenn D.
Member
 
Registered: May 2009
Location: ACT - Australia
Distribution: Opensuse x86_64 (Latest)
Posts: 132

Rep: Reputation: 26
resolving


Hello
How can I fix the following script [1] to get get around this error. How the proplem row be dropped ?
Thanks Glenn

# mysql < genschema.sql
ERROR 1062 (23000) at line 4: Duplicate entry 'localhost-cacti' for key 'PRIMARY'

[1]
# cat genschema.sql
use mysql;
DROP DATABASE IF EXISTS cactidb;
DROP SCHEMA IF EXISTS cacti;
INSERT INTO user (host, user, password, select_priv, insert_priv, update_priv) VALUES ('localhost', 'cacti', PASSWORD('cactipw'), 'Y', 'Y', 'Y');
flush privileges;
SELECT host, user, password FROM user WHERE user = 'cacti';
create database cactidb;
GRANT ALL PRIVILEGES ON cactidb.* to 'cacti'@'%' IDENTIFIED BY 'cactipw' WITH GRANT OPTION;
flush privileges;
show databases;
exit
 
Old 04-09-2011, 03:14 AM   #2
ted_chou12
Member
 
Registered: Aug 2010
Location: Zhongli, Taoyuan
Distribution: slackware, windows, debian (armv4l GNU/Linux)
Posts: 431
Blog Entries: 32

Rep: Reputation: 3
Quote:
Originally Posted by Glenn D. View Post
Hello
How can I fix the following script [1] to get get around this error. How the proplem row be dropped ?
Thanks Glenn

# mysql < genschema.sql
ERROR 1062 (23000) at line 4: Duplicate entry 'localhost-cacti' for key 'PRIMARY'
This means you are trying to enter a same value for the primary key (must be unique) check ur table for the primary key column. Then go from there. ie, is host, user password select_priv..etc? which one is the primary key?
post the result of this:
Code:
mysqldump --all-databases

Last edited by ted_chou12; 04-09-2011 at 03:18 AM.
 
  


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
Bind isn't resolving new name brgsousa Linux - Software 9 01-23-2010 08:40 AM
Name Resolving jjena Linux - Newbie 5 01-08-2010 02:46 AM
Slow Name Resolving with 10.1 SharkBait Mandriva 4 02-20-2005 03:38 PM
Resolving IP through NetBIOS name darkfame Linux - Networking 6 01-02-2004 11:50 AM
/etc/hosts resolving before DNS resolving ? markraem Linux - Networking 4 11-02-2003 04:54 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 10:46 PM.

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