Showing posts with label mysql. Show all posts
Showing posts with label mysql. Show all posts

2015/03/12

MySQLDump

how to properly dump a complete catalog (this post is a work in progress)



    mysqldump --login-path=XX database_here --add-drop-database --add-drop-table --add-drop-trigger --add-locks --comments --disable-keys --dump-date --lock-all-tables --log-error=/tmp/mysqldump.log --routines >/data/$RUTA/$SQLLOG

saving SPs only:

    mysqldump --routines --no-create-info --no-data --no-create-db --skip-opt database_here > outputfile.sql

    

2014/09/13

MySQL Multi configuration

Example configuration of a mysqld instance in Slackware 14

root@trax:/etc/rc.d# cat /etc/my.cnf
[client]port=3307
socket=/tmp/mysql.sock2

[mysqld_multi]
mysqld     = /usr/bin/mysqld_safe
mysqladmin = /usr/bin/mysqladmin
user       = mysql
password   = mysql

[mysqld2]
socket     = /tmp/mysql.sock2
port       = 3307
pid-file   = /usr/local/mysql/var2/hostname.pid2
datadir    = /usr/local/mysql/var2
language   = /usr/local/share/mysql/english
user       = mysql

mkdir /usr/local/mysql/var2
cd /usr/local/mysql/
chown mysql.mysql var2

cd /usr
mysql_install_db --user=mysql --datadir=local/mysql/var2 --basedir=/usr

if needed copy mysqld.server.multi to /etc/rc.d

/etc/rc.d/mysql_multi start N

mysqladmin -uroot password --socket=/tmp/mysql.sock --port=PORT

mysql -uroot -p --socket=/tmp/mysql.sock --port=PORT

and allow root access if needed

2013/07/05

MySql post installation slackware

After installing MySql from source under Linux Slackware it may be a problem to have old binaries lying around in /usr/bin

here is my solution:

create an script and execute it from /usr/local/mysql

#!/bin/bash
for i in bin/*
do
echo -n "$i: "
echo
rm /usr/$i
ln -s /usr/local/mysql/$i /usr/$i
done

2013/06/23

mini howto installing slackware from a samba share

the goal is to mount an iso image of the dvd from a samba share. Slackware setup have some network drivers already loaded in the kernel. If you can do ifconfig and see your network card, why not use it to speed up installation process?

#setup network card IP, you must use an IP within your network range.
ifconfig eth0 192.168.111.222

Make sure the smb share is configured for public access in the remote machine.

in the example it's named "test", remote IP 192.168.111.3

And then follow the SOP for re/partitioning

and then (let's suppose the installdvd.iso is on the root of the share on the remote machine):

mkdir /test
mkdir /image
mount //192.168.111.3/test /test -o guest -t cifs
cd /test
#at this point you should be able to do ls and see the remote dir
mount -o loop installdvd.iso /image
#at this point you should be able to do ls /image/slackware and see the install iso content.


run setup and when selecting "Source", select "From Pre-Mounted Directory", and write

sometimes, for some odd reason, setup might umount the iso and the network share, in case of doubt press Alt F2 and check with mount.

/image/slackware

and that should do the trick.