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');
|