Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  Advanced Search
  HOME    TRACKER    MYSQL


SuperbHosting.net have generously sponsored dedicated servers to ensure a reliable and scalable dedicated hosting solution for BigResource.com.





Mysqldump W/o Password


I have to run this to dump the database

mysqldump -u root -pPASS --opt database > database.tmp

Is there anyway I can hide the PASS is a file ? I was trying to put it in /root/.my.cnf as this

[client]
password = PASS

That seems to be not working. I am not sure if mysqldump even reads that file. The only option worked for me is putting the password in a file /root/.pass and chmod it to 000 and then run this

mysqldump -u root -p`cat /root/.pass` --opt database > database.tmp

However I don't like this option because it tells you where the password is residing. I need to put this in cron so I don't like the option of showing the filename.




View Complete Forum Thread with Replies

Related Forum Messages:
How To Mask Password Using Mysqldump.exe?
I'd like to schedule a daily mysqldump.exe to backup my database. Is there any way to mask the password in the command line?

View Replies !
Mysqldump :: Read Password -p From .cnf File?
I want to do a simple mysqldump of a database. I know I can set up a cronjob to point to a script that runs

mysqldump -u username -pXXXXXXX db_name >mysql.backup

however I'm not happy with putting the password in the script. I've seen some suggestions on the web that you can use '-p hidden' and that this somehow reads from a .cnf file?

Am I worrying unecessarily here? I've looked through a number of books, but can't find a simple answer/ procedure to this.

View Replies !
Pre-empting The Password Prompt For Mysqldump
I would like to backup a mysql database automatically, say once a day. I understand that cron may be used to schedule such a task, but I first need to create a shell script which creates the database backup. (I am new to shell scripting, so please bare with me!) My first attempt was this:

#
# Creates a backup of the freelance database
#
mysqldump -h localhost -u root -p freelance > fldb_backup.sql;
When I run the script from the command line, I am prompted for my password. This would be no good if the script was scheduled, so I tried altering the command to this form:



mysqldump -h localhost -u root -p mypassword freelance > fldb_backup.sql;
When run, it still prompts for my password when. How can I get around this problem?

View Replies !
Mysqldump With Special Characters In Password
I'm having a problem with a mysql dump.

I used a "leet" password that looks something like this:

Code:
myslqldump -uyyyyyy -p$xxxxxxxxx!(K > file.sql
its giving me:

sh: -c: line 0: syntax error near unexpected token `('Doesn't like either the ! or the ( in the password

is there any way around this? escape char or something? I'd rather not have to rename all the account connection strings, etc, as everything else works fine, save for the command line dump.

View Replies !
Used Mysqldump To Dump Database But Its Not Accepting Password?
I am trying to dump the database but can't because sometimes I get error 2002 which is cannot connect to local MySQL server through socket 'tmp/mysql.sock' and sometimes I get error error 1045 which is access denied for user (Using password: YES).

Isn't the password the same as the password to access mysql or is to the password to access the shell a/c. The username and password should be that of the shell account or the mysql account?

View Replies !
Mysqldump :: Bin/mysqldump: Got Error: 1: Can't Create/write To File
When executing the following command:

bin/mysqldump -u root -p -T /Users/bj/Desktop/ tfc

The following error appears:

bin/mysqldump: Got error: 1: Can't create/write to file '/Users/bj/Desktop/acts.txt' (Errcode: 13) when executing 'SELECT INTO OUTFILE'

However, it does write the 'acts.sql' file which one of the files in the tfc database.

I suspect this has something to do with permissions, but even when I run this as 'unix root user' I get the same error.

View Replies !
Password :: Enter Password, System Beeps And Window Disappear
Whenever I type in mysql password in the command prompt, where it says: Enter password, the system just beeps and the mysql window disappears.

View Replies !
Random Password Vs. User Created Password For Site Login
Are there any security issues or other concerns that make one preferable? The client is pushing for user created passwords.

I'm mapping out the basic functionality and front-end for a MySQL/PHP back-end that will be completed by a third party. I'm a novice to MySQL but familiar with PHP and their interaction. Mainly looking for anything to support one method over the other.

View Replies !
Move Site To New Host Now Password($password) Does Not Work
SELECT & FROM members WHERE username = '$USERNAME' AND password = password('$password')

View Replies !
Mysql Password() & Unix Crypt Password...
I am creating a user administration system where system administrator
can activate services for a user, like webspace, a mail account or a
subdomain.

I now want to create a function that creates mysql databases and grant
the right privileges to a user. But the problem is that mysql wants to
have the plaintext password for the user in the "grant ... identified by
'pwd'" field, or in a manual query to update the password in the
mysql.user table with PASSWORD('pwd').

I have another database which holds the passwords for the users, these
password are stored the moment a user signs up and are used to activate
services, for example ssh access to the machine. The stored passwords
are encrypted using crypt(). So for adding a ssh service to a user, I
simply do echo "$user:$pwdhash" | chpasswd -e.

I have chosen crypt because some programs (like proftpd) don't take md5
sums.

The problems is that I don't have the plaintext password. So I cannot
add a mysql db.

So I need to create a user in mysql with a crypt password.
I tried to just "grant all privileges ... identified by 'nothing'"
and then afterwards update the mysql.user table and putt the crypt
password in there but it doesn't work like that.

Does anyone have any idea on how I could fix this, how can I create a
user in mysql without having his plaintext password and only having a
crypt hash of it.

I thought about not only storing a crypt hash, but also an md5 hash and
a mysql PASSWORD() hash.. but I think that's an ugly solution.

View Replies !
I Can Connect With Db Password Or Blank Password
I have a password setup for root (% and localhost) in Mysql 5.0.26, I can connect ok no problem. I can also connect with blank password! I know it is checking the password cuz it fails if it's wrong.

I'm sure I have only one account as well (tried to delete, recreate, etc... no change)
select * from user where user='root';
| localhost | root | *F3AD8B3C44772C17F66767F29D948D9C255BD824 | Y ...
| % | root | *F3AD8B3C44772C17F66767F29D948D9C255BD824 | Y ...

Is there an option to accept blank password!? I have this problem only for root user; Other accounts are fine.

View Replies !
Password :: Obtain Password To Database
How can I easily obtain the password to a mySQL database? Its mine, its on my server, and I have mySQL installed.

View Replies !
Password :: Change Password
I have trixbox 1.2.3 running and in freePBX it told me I need to change the password in mysql. I went into mysqladmin and privileges. I updated the passwords for a2billinguser and root.

Now I am denied from access to mysql and all services that use mysql don't work. How do I restore the default that trixbox used. I have a very large major system here and cannot just blow it away.

View Replies !
Password :: How To Get Root Password
Is there anyway of knowing the root password of a MySQL database?? I know we can change the root password to a new one, but I want the root password of an existing database. Is this possible?

View Replies !
I Changed Root Password But I Can Not Login With Changed Password
I changed the password of root with
update user set password=password('newpassword')

Then I exited. But when I want to login again , it cannot authenticate the root
I should tell you that a hacker had changed my root password before. Because it was not encrypted before.

View Replies !
4.1 Mysqldump
is it possible?
if my just did a mysqldump of a 4.1 db and want to import it into a 4.0 db?

mysqldump --skip-opt --add-drop-table db_name > dump

but then when i went to the 4.0 and did a source dump, i got some syntax errors....

do i need a flag for backwards compat?

View Replies !
MySqlDump For VB.NET
If I run mysqldump from a dos-window it works fine, but when I run exactly the same command from VB.NET it does NOT work.

The main problem is that I cann't see anything. I can see a window pop-up and close, but it is too fast for me to see anything on the window.

My command is:

mysqldump.exe klapper -u root -ppasword > c: empDumpKlapper.sql

What is wrong with the command and is there a way to keep the window open so I can see what error I get?

View Replies !
Mysqldump &
I have done:
mysqldump -u root -p --all-databases > file.sql

which dumped arounf 80megs
now, I am struggling to import it back on another server
what shoudl i use mysqimport? what syntax?

View Replies !
Mysqldump And VB 6.0 Trying
I'm trying to backup a database using the shell function on VB 6.0.
The code of VB generate the next code to pass to the shell function:

C:WINDOWSsystem32cmd.exe /k "C:Archivos de programaProgramacionmysql-5.0.37-win32inmysqldump.exe" -u root --databases myvet --single-transaction > "D:DocumentosProgramasVb60veterinariamyvet.13052007.2232.sql"

The vb 6.0 shell returns a cmd windows with "c:archivos" is not a valid command line.

the code is generated by:
strSQL = Environ("ComSpec") & " /k " _
& """" & MySQLDump & """ " _
& "-u " & datcon.vuser & " " _
& "--databases " & adoCn.DefaultDatabase & " " _
& "--single-transaction > """ & DirecBCK & "" _
& adoCn.DefaultDatabase & "." _
& Format(Date, "ddmmyyyy") & "." _
& Format(Time, "hhmm") & ".sql"""

¿What is it the error?, i don't see anything, if execute the exact code generated(minus cmd part), the backup is build.

View Replies !
Mysqldump.
I am having trouble exporting the data using mysqldump. I have a test environment running on Windows XP. When I issue the command "mysqldump -h localhost -u root --password -d tbp", only the table definitions gets exported and not the actual data. Can anyone let me know what I could be doing wrong here?

View Replies !
How Do I Use Mysqldump?
mysqldump -A --allow-keywords --comments --compatible=mssql -ppcrm2006lp --result-file=pcrmsql --user=gdawson;

using MySQL Query. I got the standard error message. Then I tried just mysqldump; again, same error message. Then I went to the MySQL command line and tried again, first the command word alone and then the command with the parameters, both with the semicolon and without. Error every time. And always the same error message. I know I have done this before.

And once I get it to dump, how do I tell it where to dump to? I try and follow the manual. But it does not help.

View Replies !
How To Use Mysqldump
mysql> mysqldump root test school> /export/home/SW/school2008.sql

and always get error

View Replies !
Where Do You Run Mysqldump?
I always get a syntax error whenever doing mysqldump in my MySQL command line. So I was wandering if I am even meant to do it in the MySQL command line itself?

Do you run it in the MySQL command line or on the normal windows command line? Or somewhere else?

I use this syntax:

mysqldump -h localhost -u username -p password mydb > mydbbackup.sql

I'm sure my syntax is fine but I can't understand why I can't find anyone who has had this kind of problem.

View Replies !
Error While Using Mysqldump
I am using Mysql 4.0.13-max-log on Solaris 2.8

If I run mysqldump like below

/usr/local/mysql/bin/mysqldump -u root -pabc -d -r
/usr/local/mysql/testbackup/schemadump.sql --all-databases

It abort with following error

/usr/local/mysql/bin/mysqldump: Can't get CREATE TABLE for table 'address'
(Can't open file: 'address.InnoDB'. (errno: 1))

But if I take out -u root -p option then it work fine. Also I don't have any
table like address, see below Code:

View Replies !
Restoring From A Mysqldump
I have a file produced by mysqldump and I need to restore it. Can
someone point me toward the instructions on how to do this?

View Replies !
Help Mysqldump Ccommand
I'd like help with the mysqldump command so that the fields are delimited by
the four characters, *&&*. I'd also like for any apostophe,', or quote,",
not to be escaped.

View Replies !
Mysqldump Out Of Memory
I have some some large tables, 30 mil rows, some rows has long blogs size (300M). I used mysqldump -q to dump it, but i still get out of memory error.

View Replies !
Mysqldump Blob
I have a databse with jpg in a blob field. I want to back it up with mysqldump, but it appears to time out. Is there a way to limit the number of records backed up (possibly with the where clause,) so that I can backup my big table in blocks?

View Replies !
Restoring From Mysqldump
How do I restore a single database (selectively) from a mysql dump of
many databases. ie: I have a server with a few databases on it, I have run:

mysqldump --all-databases > all_databases.sql

Which has created a nice file ..... Now what do I do if I just want to restore just one of the databases I have just dumped into this file.

View Replies !
5.0 Mysqldump-query
I upgraded to MySQL 5.0, but the remote server still runs 3.23. Before I upgraded I was able to, in a local DOS-prompt, execute a mysqldump and get the database from the server to a file on my computer. Now, when I execute the same query, the remote server does not understand my command.

This is what I execute on my local computer (simplified):
C:foldermysqldump --add-locks --add-drop-table -h xx.xx.xxx.xx -u username -p database > "C:folderdb_downloaded.sql"

This used to work, but after I upgraded I get the error message:
Couldn't execute '/*!40100 SET @@SQL_MODE='' */': Query was empty (1065)

View Replies !
Analysing MySQLDump
regular expression to extract the table names and the number of rows in each from the output of a SQL file produced by MySQLDump? I'm using this to verify from MySQLDump.

View Replies !
Mysqldump Question
this is one about the results of a dump...basically nada. I entered:

/usr/local/bin/mysqldump -q -hMydb.some.com -uMyuser -pMypass

and got:

Usage: mysqldump [OPTIONS] database [tables]
OR mysqldump [OPTIONS] --databases [OPTIONS] DB1 [DB2 DB3...]
OR mysqldump [OPTIONS] --all-databases [OPTIONS]
For more options, use mysqldump --help

whether to file or screen, no matter what options I enter. I don't get any error messages, e.g., connection problems.

View Replies !
CRITICAL: Mysqldump
I am using version 4.1.10a and noticed a really big problem.

When I encryped sensitive data using AES_ENCRYPT and then performed a routine mysqldump for backup purposes, the resulting dump file does not preserve many of the encrypted characters properly.

AES_ENCRYPT is unusable if system admins cannot back up their tables reliably.

View Replies !
Syntax For MySQLDump?
I have done some research into a mysql dump, but cant really figure out the syntax. If I have a table names dis, and with user name of root and password of password, what sort of string would I need?

View Replies !
MYSQLDUMP :: In CSV Format
Im trying to export my table in csv formatt? I cant seem to get it to work im getting this error:
mysqldump: unknown option -s

i dont have a -s in my script heres my script:

mysqldump -u root -fields -terminated-by=,-tab= c: emp -tables ehpadmin direct_referral > new.txt

View Replies !
Mysqldump 1 Table
Is there any ways I can use mysqldump to actually dump all the data in a certain table?

View Replies !
Mysqldump Priority
I have a cron job which backs up my DB. I've set the user that runs that job to have a NICE (priority) of 18 and I see that it's 18 while it's running. However, Apache becomes (almost) completely unresponsive during this (which has a NICE of 0). I do notice in top that the PRI of mysqldump is -8. I can't figure out how to change that though.

View Replies !
Mysqldump Shortcut
I'm trying to create a shortcut in windows xp which runs mysqldump to backup my online database to a file on my pc. I have used mysqldump via the command line to do this just fine but when i create a shortcut using exactly the same parameters it just doesnt work, i get a prompt come up asking for my password which is what i want, but after that it just disappears & nothing is downloaded
This is what i have in the shortcut 'target' box...

"C:Program FilesMySQLMySQL Server 5.0inmysqldump.exe" mysqldump -h hostname -u username -p databasename > "C:ackupmysqldb.dump"

Im having one of those 'why the **** doesnt this work?!?!' type moments so any help gratefully received.

View Replies !
Mysqldump Stops
I get mysqldump (fedora 3) work until it founds this error:
/usr/bin/mysqldump: Got error: 1033: Incorrect information in file: './mysql/help_category.frm' when using LOCK TABLES
This is first mysql database installed itself.
There are a lot of tables in mysql database that display the same error msg when I try to see their structure with phpMyAdmin.
How may I fix this?

View Replies !
Mysqldump Utility
We have taken the Backup of MySQl database with version
mysql Ver 14.7 Distrib 4.1.8, for pc-linux (i686) Using mysqldump utility.

We tried to Restore the Same in another Linux System with mysql version mysql Ver 14.12 Distrib 5.0.13-rc, for pc-linux-gnu (i686) using readline 5.0 using the same mysqldump utily

It is giving Version mismatch error and unable to restore the Database. We also used --compatible=mysql40 Option but No change

View Replies !
Mysqldump View
I try to dump the view definition and records using the following command.

mysqldump -uroot -psecret! --databases test --tables proxy_view > mytest.txt

What all I get is the view definition without records. What is the correct method of dumping a view?

View Replies !
Query In Mysqldump
I need to do incremental-type backups ona mysql db. To this end I've been given a flag field to indicate whether the record's been backed up or not. If this is the best way or not is moot, this is how I've been told to do it. I was also told it's possible to specify which records to backup using a WHERE clause, but I can't find any info about doing such a thing.

My thought is that maybe I should use a query to create a temp table, backup THAT, and then drop it when I'm done.


View Replies !
Mysqldump File
I know I knew how to do this, and I know that I found it somewhere in the manual, but it's Monday and I'm heading out so I thought I'd ask you all and hopefully have an answer when I get back on Tuesday so I can stop banging my head against the keyboard.
Recently set up mysql 4.0.20a on a development machine to try and upgrade to 4.1 before I blow up the live database and I make an hourly dump form the live database using mysqldump.I grabed the latest dump and moved it to the development machine but I can't for the life of me recall how to take that file and make it create all the database, tables, and data on the new install.
Any thoughts linkage to the right portion of the MySQL manual definatly acceptable
As an aside, did anyone else find the MySQL page to be extremely slow today (2/7/2005)


View Replies !
Mysqldump To Backup
How do I use mysqldump to backup only one or two tables, not the whole database?

View Replies !
Using The Mysqldump Command
I've been doing some research into creating a backup script for my PHP website. Using the mysqldump command looks like the best way to go. I am unsure on one thing though - where does it save the file to?

Like if I don't specify a path to the file, just something like 'dump.sql', then where will it save the file to? And how do I make it save to, for example, the root folder of a users website? My script may be on different websites so the path to the root folder of the website may change.

View Replies !
Out Of Memory After Mysqldump
Using all InnoDB tables v5.0.16 under Linux, Get this message:

[ERROR] Out of memory; check if mysqld or some other process uses all available memory; if not, you may have to use 'ulimit'
to allow mysqld to use more memory or you can add more swap space

It only happens after all databases have been dumped from the instance.
Any ideas?

View Replies !
Mysqldump Problem
I did a mysql dump of a database between two servers we have using the following command:

mysqldump --opt <db_name> -u <username> --password=<password> | mysql --host=<hostname> -C <db_name> -u <username> --password=<password>

This command seemed to run ok as it transferred all the structure and data from the original server to the new server database.

However, on closer inspection there is a problem. Many characters in the new database are showing up as a a question mark ? (e.g. characters such as ", trademark symbol, and fractions such as 1/3).

If I edit this data using phpmyadmin and replace it with the relevant symbol manually then it is ok.

There are hundreds of instances of these characters in the database and to change them manually would be very time consuming.

Is there and option regarding character sets I can set in the mysqldump that might solve this problem?

View Replies !
Mysqldump #1064
I've used the mysqldump command and successfully created a backup.sql file. [MYSQL 4]

I've tried to import it using phpMyAdmin and it outputs the following error:

Error

SQL query:

-- MySQL dump 8.23
--
-- Host: localhost Database: www_mysite_net
------------------------------------------------------- --
-- Server version 4.1.14-standard
--
-- Table structure for table `broadcast_news`
--
DROP TABLE IF EXISTS broadcast_news;

MySQL said: Documentation
#1064 - 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 '---------------------------------------------------------
-- Server version 4.1' at line 1

By MANUALLY deleting the line:------------------------------------------------------- --I was able to solve the problem.

Is there anyway to solve this automatically by adding a special option in the mysqldump?

View Replies !
Mysqldump -X | Mysql?
I am contemplating doing some version control using mysqldump and subversion, but it seems that mysqldump produces some very long lines (and no option to split them up). Since (IINM) subversion works by diffing whole lines it would cause the svn repository to become unnecessarily large.

It occurs to me that I could use the '-X' option to mysqldump and it seems that would work very nicely with subversion.

However, there doesn't seem to be any way to get the stuff back into mysql. There's a way to import into a single table, but no way to do the whole shebang.

...or is there?

XML does produce a lot of overhead, so perhaps something as simple as running the mysqldump output through 'sed -e 's/,/,/'` might do the trick (new lines are ignored, right)? Any 'gotchas' with that?

View Replies !
Transfer Db, Mysqldump
i intended to use mysqldump to 'export' the current db
mysqldump -uusername -ppassword -hhostname databasename >filepath
and then import at the new server with
mysql -uUsername -pPassword -hHostname <filepath

however, can't get mysqldump to accept my password, and i also tried
mysqldump --user=username --password=password databasename >filepath

the error i get
mysqladmin: connect to server at 'localhost' failed
error: 'Access denied for user 'root'@'localhost' (using password: YES)'

please believe me i do know what my password is and i know how to type

i've had this same problem before with mysqladmin, and found to get around it i just submit username only and when prompted for the password, at the command line, only then does it accept it, but nothing works with mysqldump

anybody else have this problem and how to make mysqldump work?

View Replies !
Does Mysqldump Replace Everything?
I've made design changes to a test MySQL database on my local machine, and I would like to replace the MySQL database on my Internet server (which is also currently a test db).

Does the mysqldump command wipe out everything in the target database, and replace the *all* the objects (tables, indexes, relationships etc) and data?

View Replies !

Copyright © 2005-08 www.BigResource.com, All rights reserved