linux上装多个mysql
安装步骤
1先安装好第一个mysql :
#tar zxvf mysql*.tar.gz
#cd mysql*
#groupadd mysql
#useradd -g mysql mysql
#./configure --prefix=/usr/local/mysql #make
#make install
#scripts/mysql_install_db
#chown -R root /usr/local/mysql
#chown -R mysql /usr/local/mysql/var
#chgrp -R mysql /usr/local/mysql
#cp support-files/my-medium.cnf /etc/my.cnf
#/usr/local/mysql/bin/safe_mysqld --user=mysql &
#ln -s /usr/local/mysql/bin/mysql /usr/bin/mysql
#/usr/local/mysql/bin/mysqladmin -u root password uarefool
#echo "/usr/local/mysql/bin/safe_mysqld& --user=mysql" >> /etc/rc.d/rc.local
2安装另外的,
#mysql_install_db --datadir=数据库文件夹(如/home/var)
#chown -R mysql:mysql 数据库文件夹(如/home/var)
拷贝一个my.cnf
#cp /etc/my.cnf /etc/my.cnf2
配置my.cnf2
端口改成其他的比如3307
sock改成 /tmp/mysql.sock2
数据库文件夹位置在
[mysqld]节点下面配置
增加 datadir= 数据库文件夹(如/home/var)
增加节点[mysqld_safe]
pid-file=/home/var/mysqld.pid
log-error= 之类的
bin#mysqld_safe --defaults-file=/etc/my.cnf2 --pid-file=/home/var/mysqld.pid &(如果配置文件里面配置pid-file了 ,这里的pid-file这个参数可以省略)
登陆新的数据库 或改密码 要指定 sock文件位置
如mysql -S /tmp/mysql.sock2
mysqladmin -S /tmp/mysql.sock2 -uroot password root (设置数据库的用户名密码)
相关文档:
Linux下转换字符集(UTF8转换)(转) 收藏
在LINUX上进行编码转换时,既可以利用iconv函数族编程实现,也可以利用iconv命令来实现,只不过后者是针对文件的,即将指定文件从一种编码转换为另一种编码。
一、利用iconv函数族进行编码转换
iconv函数族的头文件是iconv.h,使用前需包含之。
#include <iconv.h& ......
Linux, named after the inventor, Linus Torvalds, is a so different OS for everyone against Windows. To everyone who used to use Windows, Linux need us to do more for everything which we usually do by computer, such as playing a video.
Someone says, Linux is for the ones who are good at the computer ......
#include <stdio.h>
#include <sys/select.h>
#include <termios.h>
#include <unistd.h>
#include <ctype.h>
#define STDIN 0
int main()
{
struct timeval tv = {0,0};
struct termios term , termbak;
& ......
dnw in linux
Use xterm as a serial terminal. In Fedora 9
use "yum install screen" to install screen package.
Plug the USB-UART cable, see if there is a ttyUSB0 in /dev
Enter "screen /dev/ttyUSB0 115200,cs8,-ixon,-ixon,istrip" to connect to USB-UART.
Screen as Serial Terminal
Download the ......