您好,欢迎来到三六零分类信息网!老站,搜索引擎当天收录,欢迎发信息

linux问题总结_MySQL

2025/5/17 11:26:26发布32次查看
1.修改redhat enterprise5 语言问题描述:切换语言
cd /etc/sysconfig
vi i18n
将lang=en_us.utf-8
改成lang=zh_cn.gb2312
2.bash: ifconfig: command not found问题描述:
切换到root用户下
[root@localhost /]$ ifconfig 
依然提示:“bash: ifconfig: command not found”
whereis ifconfig 看一下这个命令在哪个目录下
方法一:[root@localhost sbin]$ /sbin/ifconfig 就可以出现使用了 方法二:[root@localhost sbin]$ export path=$path:/sbin 这样设置后,下次就可以直接访问了,免处第一种的麻烦
方法三:修改/etc/profile文件,注释掉if语句即可
把下面的if语句注释掉: 
# path manipulation 
if [ $euid = 0 ]; then 
pathmunge /sbin 
pathmunge /usr/sbin 
pathmunge /usr/local/sbin 
fi 
修改为 
# path manipulation 
# if [ $euid = 0 ]; then 
pathmunge /sbin 
pathmunge /usr/sbin 
pathmunge /usr/local/sbin 
#fi
3. redhat linux开机就进入到命令行 vi /etc/inittab id:5:initdefault: 把这一句里面的5改成3就
4. redhat安装jdk失败在 red hat enterprise linux5安装 jdk-7u21-linux-i586.tar.gz 时候出现下面的错误 :
error: dl failure on line 864
error: failed /home/jiangyang/jdk1.7.0_21/jre/lib/i386/client/libjvm.so, because /home/jiangyang/jdk1.7.0_21/jre/lib/i386/client/libjvm.so: cannot restore segment prot after reloc: permission denied
解决方案:
chcon -t textrel_shlib_t $java_home/jre/lib/i386/client/libjvm.so
5. 设置mysql远程连接root权限 mysql> grant all privileges on *.* to'root'@'%' identified by '密码' with grant option;
(%表示是所有的外部机器,如果指定某一台机,就将%改为相应的机器名;‘root’则是指要使用的用户名,)
mysql> flush privileges;
(运行此句才生效,或者重启mysql)
6. ubuntu 配置静态ip root@ubuntu1:~# vi /etc/network/interfaces
# this file describes the network interfaces available on your system
# and how to activate them. for more information, see interfaces(5).
# the loopback network interface
auto lo
iface lo inet loopback
# the primary network interface
auto eth0
iface eth0 inet static
address 192.168.2.111
netmask 255.255.255.0
gateway 192.168.2.1
root@ubuntu1:~# /etc/init.d/networking restart
如果配置动态ip如下:
# this file describes the network interfaces available on your system
# and how to activate them. for more information, see interfaces(5).
# the loopback network interface
auto lo
iface lo inet loopback
# the primary network interface
auto eth0
iface eth0 inet dhcp
7ubuntu 安装 chkconfig 在ubuntu 中是没有chkconfig命令,通过安装chkconfig_11.0-79.1-2_all.deb来达到使用chkconfig命令的目的。
8.ubuntu mysql安装 安装mysql-6.0.7-alpha-linux-i686-glibc23.tar.gz 版本的linux。
groupadd mysql
useradd -g mysql mysql
cd /usr/local
gunzip
ln -s full-path-to-mysql-version-os mysql
cd mysql
chown -r mysql .
chgrp -r mysql .
scripts/mysql_install_db --user=mysql
chown -r root .
chown -r mysql data
bin/mysqld_safe --user=mysql &
/usr/local/mysql/bin/mysqladmin -u root password ‘新密码’
cp support-files/mysql.server /etc/init.d/mysql
chmod +x /etc/rc.d/init.d/mysql
chkconfig --add mysql
cp support-files/my-medium.cnf /etc/my.cnf
service mysql start
9. linux下的mysql乱码在linux下中使用mysql的话可能会出现中午乱码的情况。通过查询mysql的编码集可以发现是使用的latin1需要修改。
修改/etc/my.cnf配置文件。
# the following options will be passed to all mysql clients
[client]
#password       = your_password
port            = 3306
socket          = /tmp/mysql.sock
default-character-set=utf8
# here follows entries for some specific programs
# the mysql server
[mysqld]
port            = 3306
socket          = /tmp/mysql.sock
skip-locking
key_buffer = 16m
max_allowed_packet = 1m
table_cache = 64
sort_buffer_size = 512k
net_buffer_length = 8k
read_buffer_size = 256k
read_rnd_buffer_size = 512k
myisam_sort_buffer_size = 8m
default-character-set=utf8
重启数据库后再次查看数据库的编码集信息。
/etc/init.d/mysql stop
/etc/init.d/mysql start
该用户其它信息

VIP推荐

免费发布信息,免费发布B2B信息网站平台 - 三六零分类信息网 沪ICP备09012988号-2
企业名录 Product