MySQL Forums
Forum List  »  Backup

mysqldump: unable to backup database
Posted by: Richard Stevens
Date: April 08, 2017 06:13AM

Hi all,

I'm having a problem to backup my database. Error message is shown below. Please advise.

This is the error message:
MariaDB [db_test]> mysqldump db_test > db_test.sql;
ERROR 1064 (42000): 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 'mysqldump db_test > db_test.sql' at line 1
MariaDB [db_test]>

MariaDB [db_test]> status
--------------
mysql Ver 15.1 Distrib 10.0.17-MariaDB, for Linux (i686) using readline 5.1

Connection id: 32
Current database: db_test
Current user: root@localhost
SSL: Not in use
Current pager: less -EM
Using outfile: ''
Using delimiter: ;
Server: MariaDB
Server version: 10.0.17-MariaDB Source distribution
Protocol version: 10
Connection: Localhost via UNIX socket
Insert id: 1
Server characterset: latin1
Db characterset: latin1
Client characterset: latin1
Conn. characterset: latin1
UNIX socket: /var/run/mysqld/mysqld.sock
Uptime: 1 hour 38 min 46 sec

Threads: 2 Questions: 187 Slow queries: 0 Opens: 14 Flush tables: 1 Open tables: 4 Queries per second avg: 0.031
--------------

MariaDB [db_test]>

This is how I created the database.
MariaDB [(none)]> SHOW DATABASES;
+--------------------+
| Database |
+--------------------+
| information_schema |
| mysql |
| performance_schema |
+--------------------+
3 rows in set (0.00 sec)

MariaDB [(none)]>
MariaDB [(none)]> CREATE DATABASE db_test;
Query OK, 1 row affected (0.00 sec)

MariaDB [(none)]>
MariaDB [(none)]> SHOW DATABASES;
+--------------------+
| Database |
+--------------------+
| db_test |
| information_schema |
| mysql |
| performance_schema |
+--------------------+
4 rows in set (0.00 sec)

MariaDB [(none)]>
MariaDB [(none)]> USE db_test
Database changed
MariaDB [db_test]> SHOW TABLES;
Empty set (0.00 sec)

MariaDB [db_test]> CREATE TABLE user (id int(11) not null PRIMARY KEY AUTO_INCREMENT, first varchar(128) not null, last varchar(128) not null, uid varchar(128) not null, pwd varchar(1000) not null );
Query OK, 0 rows affected (0.00 sec)

MariaDB [db_test]>

MariaDB [db_test]> SHOW COLUMNS FROM user;
+-------+---------------+------+-----+---------+----------------+
| Field | Type | Null | Key | Default | Extra |
+-------+---------------+------+-----+---------+----------------+
| id | int(11) | NO | PRI | NULL | auto_increment |
| first | varchar(128) | NO | | NULL | |
| last | varchar(128) | NO | | NULL | |
| uid | varchar(128) | NO | | NULL | |
| pwd | varchar(1000) | NO | | NULL | |
+-------+---------------+------+-----+---------+----------------+
5 rows in set (0.00 sec)

MariaDB [db_test]>

MariaDB [db_test]> SELECT * FROM user;
Empty set (0.00 sec)

MariaDB [db_test]>

MariaDB [db_test]> INSERT INTO user (id, first , last , uid , pwd) VALUES (null , 'John' , 'Doe' , 'admin' , '123');
Query OK, 1 row affected (0.00 sec)

MariaDB [db_test]> SELECT * FROM user;
+----+-------+------+-------+-----+
| id | first | last | uid | pwd |
+----+-------+------+-------+-----+
| 1 | John | Doe | admin | 123 |
+----+-------+------+-------+-----+
1 row in set (0.00 sec)

MariaDB [db_test]>

Options: ReplyQuote


Subject
Views
Written By
Posted
mysqldump: unable to backup database
8737
April 08, 2017 06:13AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.