I am a linux beginner, especially ubuntu. I want to manage the mysql database installed on my Ubuntu web server by using Putty. But the MySQL syntax that I run always fails. Example syntax:
mysql -u root -p
All failed messages are the same for any syntax:
mysql: unknown variable 'bind-address = 0.0.0.0'
I don't know whether to run the Mysql syntax on Ubuntu I need to go to a certain Folder/Path, like in windows if I want to run the mysql syntax I need to go to the path where MySql is installed, for example C:/xampp/mysql/bin and then run the syntax mysql -u root -p.
is there anything I miss? and what should i do? please help, thank you.
Option 1: A typo in a title
Have a look in your my.cnf file.
Maybe you have a typo: There should be [mysqld] instead of [mysql] section
[mysqld] bind-address=0.0.0.0
OR
[mysqld]
bind-address=0.0.0.0
Source
Option 2: Is it Maria DB?
Are you sure you are using MySQL ?
This looks like a MariaDB error.
Try to remove the bind-address from your mysql.cnf file.
Option 3: Check for any whites-pace?
Try editing the file and using show all characters in your editor (e.g. Notepad Plus Plus). Maybe there are whitespace characters ( such as spaces ) causing problems.
I am trying to export a database in mysql from Mac terminal using
/Applications/MAMP/Library/bin/mysqldump -u root -p databasename tablename > /Users/mir/Documents/data.sql
It's giving me an error mysqldump: [ERROR] unknown variable 'column-statistics=0'
I have tried many solutions like
(i) adding "--column-statistics=0" in the query itself and
(ii) adding
[mysqldump]
column-statistics=0
in my.cnf at /Applications/MAMP/conf/my.cnf.
Nothing solve the issue.
Looking for help.
Find your my.cnf file using command in terminal "locate my.cnf"
My case I put
[mysqldump]
column-statistics=0
in /Applications/MAMP/conf/my.cnf to solve the issue.
I am having a problem with the mysqldump command in general (import/export).
I write in windows command window the following:
C:\MySQL\MySQL Server 5.6\bin> mysqldump -u root -p nameofdabase> C:\temp\dumpfile.sql
and i get "mysqldump unknown option --no beep". It doesn't ask me for my password and it doesn't seem to recognize the mysqldump command even though I see it in the bin directory. What am I doing wrong??I have tried everything from changing paths to changing backslashes. Anything I have found online that seems to work keeps giving me the same kind of error.
Any clues will be much appreciated...Thank you all in advance
You probably have a line in my my.ini (or my.cnf) file that says "no-beep". This is an option for the mysql client, but not for mysqldump.
If you want the "no-beep" option for the mysql client only, edit your my.ini file and move it under the file section heading [mysql].
See also mysqldump unknown option no beep
There is a "default" my.ini here: C:\ProgramData\MySQL\MySQL Server 5.7\my.ini.
It contains the no-beep option.
The MySQL Installer has my.ini templates for various versions in C:\ProgramData\MySQL\MySQL Installer for Windows\Manifest\Templates\, for some reason, all of it contains this option.
I am trying to back up all databases at once from mysql server but i am getting the following error:
mysqldump: unknown option '--no-beep'
the command i am running is the following:
"C:\Program Files\MySQL\MySQL Server 5.6\bin\mysqldump" --uXXXXX --pXXXXXX --all-databases > c:\MySQL_DB_Backups\%mydate%_all_databases.sql
Any help is appreciated.
thank you.
Fixed by commenting the line in my.cnf where it says "no beep"
[Client]
#no Beep
I am encountering a problem concerning the export of a database.
First of all, I have to clarify that I am using MySQL Workbench 5.2.47. The procedure that I followed so far is the following:
I followed the instructions of http://mysqlworkbench.org/2012/07/migrating-from-ms-sql-server-to-mysql-using-workbench-migration-wizard/ in order to create a connection with my MSSQL DB in order to transform it into MySQL DB.
Then I also checked that my data is imported in the database.
Now I want to export it into an sql file / or preferably to frm,myi,myd files in order to place them in my server.
I have tried to export them from
Server Administration -> Data Export
Changed already the password from the security (Users and Privileges)
but I encounter the problem
Dumping test (all tables)
Running: mysqldump.exe --defaults-extra-file="c:\users\d_micha\appdata\local\temp\tmpgtwa_m.cnf" --user=root --max_allowed_packet=1G --host=localhost --port=3306 --default-character-set=utf8 --single-transaction=TRUE --routines --events --no-data "test"
mysqldump: Got error: 1045: Access denied for user 'root'#'localhost' (using password: NO) when trying to connect
Operation failed with exitcode 2
I don't know what I might be doing wrong and I have searched in google to find the solution, but it should be normally exported.
Any other information will be given upon request.
Thank you.
I've seen this issue when you don't have the LOCK TABLES permission. You'll see this error before the rest of the access denied errors in the log. Try disabling LOCK TABLES in advanced settings in the Data Export panel of the workbench.
mysqldump: Got error: 1044: Access denied for user 'XXX'#'%' to database 'XXX' when doing LOCK TABLES
Solution 1 - Provide correct config file to each mysqldump-call
This is more a workaround, but it will get you to the desired result. Just use the provided information to get a dump of your MySQL-Table from the CLI - basically it's just copy & paste:
As you can see from the log mysqldump has the parameter --defaults-file. This file can and will contain connection credentials, like the password. Apparently MySQLWorkbench is not providing the password with this file ("using password: NO").
So just create a file named database.cnf and put it somewhere to your computer (e.g. c:\temp\database.cnf) containing the credentials like this:
[client]
user=root
password=your-root-password
single-transaction=TRUE
host=localhost
port=3306
default-character-set=utf8
max_allowed_packet=1G
As this also works with any other parameter from the command line, you may also add all your other stuff like, --single-transaction etc.
Now take your log file entry:
Running: mysqldump.exe --defaults-extra-file="c:\users\d_micha\appdata\local\temp\tmpgtwa_m.cnf" --user=root --max_allowed_packet=1G --host=localhost --port=3306 --default-character-set=utf8 --single-transaction=TRUE --routines --events --no-data "test"
And replace the --defaults-extra-file parameter to point to your database.cnf - also remove the "Running:" info and every parameter you are already providing in your database.cnf:
mysqldump.exe --defaults-extra-file="c:\temp\database.cnf" --routines --events --no-data "test"
Then open a Shell, go to your MySQLWorkbench-Folder and run the command, e.g:
cd c:\Program Files\MySQL\MySQL Workbench 6.3 CE\
mmysqldump.exe --defaults-extra-file="c:\temp\database.cnf" --routines --events --no-data "test" > c:\Users\user\Downloads\table1.sql
Do not forget to route the output to a file!
Long story short: Use the CLI tool mysqldump, MySQLWorkbench is doing the same, but not the correct way.
Solution 2 - Provide a global correct config file
mysqldump also reads a global config file, if it exists in one of those locations:
C:\WINDOWS\my.ini
C:\WINDOWS\my.cnf
C:\my.ini
C:\my.cnf
c:\Program Files\MySQL\my.ini
c:\Program Files\MySQL\my.cnf
So you can just put the information from the above edited cnf-file to one of this locations and run the mysqldump-command without the --defaults-file-parameter
Solution 3 Just call mysqldump with no parameters
This is maybe the most sophisticated solution: The my.cnf will will work with any parameter that mysqldump accepts. So why don't just use this to configure your dump? Just add all parameters to your my.cnf
[client]
user=root
password=secretPassword
single-transaction=TRUE
host=localhost
protocol=tcp
port=3306
default-character-set=utf8
skip-triggers=TRUE
all-databases=TRUE
all-tablespaces=TRUE
Now run mysqldump on the shell / command line, without any parameters, and you're good:
cd c:\Program Files\MySQL\MySQL Workbench 6.3 CE\
mysqldump.exe > c:\Users\user\Downloads\dump.sql
Please try this solution https://bugs.mysql.com/bug.php?id=91640.
Actually we can use an advanced option in Workbench to disable column statistics as per https://stackoverflow.com/a/52944315/1694902 - see below:
Go to Management/Data export
Choose the schema to export in the 'Tables to export' list
Click the 'Advanced Options...' button (top right)
Search for the option 'Other/column-statistics'
Set the value to 0
Click the 'Return' button (top right)
According to the author of this post, "Unfortunately, you'll have to do that every time you start MySQL Workbench."
It's work for me, may be it can help others.
Operation failed with exitcode 2
also occurs with column statistic issues, which I fixed this by amending the MySQL Workbench config file wb_admin_export.py.
See my answer here.
MySQL workbench is trying to access your database without a password (notice the using password: NO in the error). Surprisingly you managed to get access to the server instance. Recreate the server instance, or at least try with a newly created instance.