How to be enable to use man command for mysql - mysql

I have recently encountered a problem in using the command man and the switch --help in mysql. Whenever I enter the command "man select" or ....
or when I use the "select --help" I recieve this error message:
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'mysqld --verbose --help' at line 1
The fact is that neither the "man" command nor the "--help" switch work for any other command. My guess is that the man pages are not installed by my system. I use "ubuntu 14.04" and have installe my LAMP STACK via using the "apt-get install" command.
Would you help me fix this issue? I thank you very much in advance.

From the OS command prompt (where you executed the apt-get):
$ man mysql
$ mysql --help
From within the mysql client:
mysql> help select

I think you must see your manual
it's prove man command or not.

Related

syntax error with mysqldbcompare command

mysql -V is 5.5.54 for debian (Jessie).
I'm at the mysql command prompt trying to run this command:
mysqldbcompare --server1=root#localhost calendar_dup:calendar --run-all-tests
I get the following error:
ERROR 1064 (42000): You have an error in your SQL sytax; check manual that corresponds to your MySQL server version for the right syntx to use near 'mysqldbcompare --server1=root#127.0.0.1 calendar_dup:calendar --run-all-tests' at line 1
Needed to install via apt-get: https://packages.debian.org/jessie/mysql-utilities
Also, should be run from shell command line, not mysql command line.

How to resolve backticks error while using -e with mysql client?

Hi I am trying run belo sql on Ubuntu terminal using MySQL client
mysql -u root \
-proot -e "SELECT * FROM knexus.redis_cache WHERE `key` LIKE '%hub.local%'"
I am getting below error
The program 'key' is currently not installed. You can install it by typing:
sudo apt-get install donkey
ERROR 1064 (42000) at line 1: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'LIKE '%hub.local%'' at line 1
However SQL run properly on MYSQL terminal.
I guess this might be issue character escaping issue, as I see sudo apt-get install donkey.
The ticks framing key cause the bash to treat key as a command and replace it by its output in the command. You could either try without them or put the whole command in single quotes and the %hub.local% in double quotes.

Setting up timezones in mysql

I'm a MySQL/WAMP newbie attempting to set up timezones so that I could follow along with a course on the topic, but then I started having troubles when the instructions I was being given didn't correspond to the info on the MySQL page from which I was to download the setup file, http://dev.mysql.com/doc/refman/5.7/en/mysql-tzinfo-to-sql.html.
Can anyone tell me why, when I attempt to run this command from the mysql command prompt:
mysql -u root mysql < C:/timezone_posix.sql;
I get this error:
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'mysql
BTW, I've tried that with both forward and backward slashes, with and without quotes, etc., from my WAMP 5.6.17, MySQL command prompt, and the file in question is the posix (not isam) version that corresponds to the MySQL version on a windows machine.
You should be running that from the regular command prompt, not inside the mysql program, since it runs the mysql program. So it should be at the C:\ prompt.
Or you could use the mysql source command to read from a file:
mysql> use mysql
mysql> source 'C:/timezone_posix.sql'

Unable to create mysql database dump

I am unable to create mysql database dump. I have tried all the commands in the below question
https://stackoverflow.com/questions/24858436/unable-to-create-mysql-dump-in-mysql-server-5-6-19
But every time I get similar error which asks me to check manual
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that
corresponds to your MySQL server version for the right syntax to use near 'mysql
dump -u root -pmysqlmysql hospital_management -r "c:\hosp.sql"' at line 1
I am trying these commands in Mysql command line and NOT on Windows command prompt. Also I am trying these commands before entering any database in mysql.
mysql> mysqldump -u root -pmysqlmysql hospital_management > hosp.sql
This was the first command I tried, which did not work
mysqldump is an executable, you should not run it in the MySQL command line.
Try the command
mysqldump -uroot -pmysqlmysql hospital_management > "C:\hosp.sql"
By reading the documentation, I assume that when using -r, the file must already exist.

mysql console > mysqlbinlog You have an error in your SQL syntax

I have WAMP installed that has been binary logging all changes in my database. I found the logs, the mysql console also shows them when I perform a SHOW BINARY LOGS. But when I try to read them by executing:
mysqlbinlog mysql-bin.000197
it gives me that error:
ERROR 1016(42000) You have an error in your SQL syntax; check the manual
that corresponds to your MySQL server version for the right syntax to use
near 'mysqlbinlog mysql-bin.000197' at line 1
MySQL version is 5.5.20
have you used shell command ?
shell> mysqlbinlog mysql-bin.000197