MySQL

From MyLinuxNotes

Jump to: navigation, search

what is the top college for international studies health money go2clickbank.com ankle his mature blowjob movies mad tv james blunt video webmap quarkexpress 6.5 crack thompson shore ultram tramadol hci tablet respirometers ut pharmacy school factory mutual fm approved hawksley lyric workman music video sales idina menzel video clips instructional oral sex video index free reverse cell phone directory page spring break blowjob movie clubs toronto seiko kinetic watch airwolf video clips migun massage bed merchants of deception colocation services nevada federal firearm license hbw financial services drama forbidden korean love historical figures albuterol unit dose nebulizer link index state of ohio license cheese kraft mac longboard videos terazosine drug paul hardcastle and rain forest gay sucking and fucking street fights video downloads african pussy site site avalon movie theatre in nanaimo maine movie listings preteen lesbian movie acme video games los angeles octane movie trailer showgirl movie portable basketball hoops real player video clip live sex video chat shelby cobra 427 wallpaper adrien brody movie mountain photos everquest ppc serial license pennsylvania wedding movie film stock registery cleaner crack linux drivers for wpc54gs cancun airport arkansas ft newspaper smith video sleeve greatest hit mule kills mountain lion video lane furniture serial numbers page domain existential psychotherapy newt spanish teaching positions trouble coldplay guitar tab domain a310 ringtone samsung sch anberlin a day late video the bucket kings of leon lyrics extreme hentai http male movies.com tgp.shtml pictures of pirate ship cannon banging babes puzzle pirates washington state homes matt damons first movie role pink kink movie To see how I set this up check out SquirrelMail.

Logs

After I set this up I would get cron error messages:

    /etc/cron.daily/logrotate:

    /usr/bin/mysqladmin: connect to server at 'localhost' failed
    error: 'Access denied for user: 'root@localhost' (Using password: NO)'

To fix this I edited my /etc/logrotate.d/mysqld to this:



/var/log/mysql/mysql.err /var/log/mysql/mysql-bin.*{
       create 600 mysql mysql
       notifempty
       missingok
   postrotate
       # just if mysqld is really running
       if test -n "`ps acx|grep mysqld`"; then
               /usr/local/mysql/bin/mysqladmin flush-logs
       fi
   endscript
}

The above will not work because there is no mysqladmin password included. So you don't have to include it in this file just create a ~/.my.cnf like:


    [mysqladmin]
    password = <password>
    user= root

    [mysql]
    password = <password>
    user= root

This will allow root to use mysqladmin and mysql without being prompted for a password.

MySQL also was not logging anything that I could see (logs were created, but empty). So I changed my /etc/my.cnf. Here are the changes:


 [mysqld]
 datadir=/var/lib/mysql
 socket=/var/lib/mysql/mysql.sock
 log-bin=/var/log/mysqld-bin
 #log=/var/log/mysql/mysqld        # uncomment for VERY verbose logging
 skip-bdb                          # tells server I don't have support for BerkeleyDB
[mysql.server] user=mysql basedir=/var/lib
[safe_mysqld] pid-file=/var/run/mysqld/mysqld.pid open-files-limit=8192

If you are running MySQL as a non-root user you need to put the logs in their own directory owned by that user so the logs can be created/written.

To read the logs you need to use mysqlbinlog.

If like me you installed from RPM's and you don't know how things were compiled. To get a lot of information about your server, login in to the server and issue SHOW VARIABLES;.


Errors

When I recently tried to make a backup of one of my databases with mysqldump -p --tab=dbbu/ --opt nuke I got:

   mysqldump: Got error: 1: Can't create/write to file '/var/www/web_root/confirm.txt' (Errcode: 13) when executing
   'SELECT INTO OUTFILE'

I really had a lot of trouble trying to figure this one out. I did a chmod 777 dbbu/, but it still didn't work. A chown mysql dbbu/ did though.


I wanted to update from 4.0.16 to 4.1 and took the plunge.

  • First I backed up the database with mysqldump -p --flush-logs --all-databases --opt > alldbs.sql
    • This did give me an error mysqldump: Got error: 1016: Can't open file: 'nuke_session.MYI'. (errno: 145) when using LOCK TABLES which I fixed with mysql> REPAIR TABLE nukesession;
  • Then I installed mysql-common-4.1, mysql-server-4.1 and mysql-client-4.1 with aptitude
  • I then made sure I was running 4.1 with mysql --version
  • I then restored from the backup with mysql -p < alldbs.sql. At the password prompt just hit enter.
  • The run within mysql FLUSH PRIVILEGES; to get your passwords to work.

If you wish to only show the table structure, without the contents, you can use the --no-data flag:

mysqldump --user=root --pass=password --all-databases --no-data
Personal tools