LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
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-17-2014, 07:27 AM   #1
Glenn D.
Member
 
Registered: May 2009
Location: ACT - Australia
Distribution: Opensuse x86_64 (Latest)
Posts: 132

Rep: Reputation: 26
What is needed to run some sql against mysql/maria database ?


Hello,
What is needed to run some sql
I have example below , but the .sql [last step] fails.
What am I missing ?

Thanks Glenn

[1]Steps done.
# mysql -u root
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MariaDB connection id is 548
Server version: 5.5.33-MariaDB openSUSE package

Copyright (c) 2000, 2013, Oracle, Monty Program Ab and others.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

MariaDB [(none)]> use mysql;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Database changed
MariaDB [mysql]> create database cactidb;
Query OK, 1 row affected (0.00 sec)

MariaDB [mysql]> GRANT ALL ON cactidb.* TO cacti@localhost IDENTIFIED BY 'cactipasswd';
Query OK, 0 rows affected (0.00 sec)

MariaDB [mysql]> SELECT user, host FROM mysql.user where user ="cacti";
+-------+-----------+
| user | host |
+-------+-----------+
| cacti | localhost |
+-------+-----------+
1 row in set (0.00 sec)
MariaDB [mysql]> exit
Bye

# mysql -u cacti -pcactipasswd -b cactidb
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MariaDB connection id is 786
Server version: 5.5.33-MariaDB openSUSE package

Copyright (c) 2000, 2013, Oracle, Monty Program Ab and others.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

MariaDB [cactidb]> exit
Bye

#
# this redirection step/run step of sql fails
# mysql -u cacti -pcactipasswd -b cactidb < /usr/share/cacti/
ERROR 1064 (42000) at line 5: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'TYPE=MyISAM' at line 6

#beginning of sql content of file.
# head -20 /usr/share/cacti/cacti.sql
--
-- Table structure for table `cdef`
--

CREATE TABLE cdef (
id mediumint(8) unsigned NOT NULL auto_increment,
hash varchar(32) NOT NULL default '',
name varchar(255) NOT NULL default '',
PRIMARY KEY (id)
) TYPE=MyISAM;

--
-- Dumping data for table `cdef`
--

INSERT INTO cdef VALUES (3,'3d352eed9fa8f7b2791205b3273708c7','Make Stack Negative');
INSERT INTO cdef VALUES (4,'e961cc8ec04fda6ed4981cf5ad501aa5','Make Per 5 Minutes');
INSERT INTO cdef VALUES (12,'f1ac79f05f255c02f914c920f1038c54','Total All Data Sources');
INSERT INTO cdef VALUES (2,'73f95f8b77b5508157d64047342c421e','Turn Bytes into Bits');
INSERT INTO cdef VALUES (14,'634a23af5e78af0964e8d33b1a4ed26b','Multiply by 1024');
 
Old 04-17-2014, 09:25 AM   #2
michaelk
Moderator
 
Registered: Aug 2002
Posts: 26,183

Rep: Reputation: 6087Reputation: 6087Reputation: 6087Reputation: 6087Reputation: 6087Reputation: 6087Reputation: 6087Reputation: 6087Reputation: 6087Reputation: 6087Reputation: 6087
Quote:
ERROR 1064 (42000) at line 5: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'TYPE=MyISAM' at line 6
Then syntax has changed from TYPE= to ENGINE=

https://mariadb.com/kb/en/create-table/
 
  


Reply

Tags
mysql


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
LXer: MySQL to Maria DB Migration LXer Syndicated Linux News 0 08-02-2013 08:51 PM
Why do we need a database program such as MySQL or MS SQL or Oracle? beckettisdogg Linux - Newbie 4 09-09-2009 07:31 PM
My SQL statement to delete an entry in MYSQL database fails in PHP ratchie Linux - Software 1 12-29-2008 02:48 AM
LXer: Protecting your MySQL database from SQL injection attacks with GreenSQL LXer Syndicated Linux News 0 08-25-2008 07:00 PM
database needed not sql herc222 Linux - Software 3 03-08-2004 07:34 AM

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

All times are GMT -5. The time now is 11:01 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