Linux problem summary

Source: Internet
Author: User

Linux problem summary
1. Modify the redhat performanise5 Language

Problem description: language change

Cd/etc/sysconfig
Vi i18n
Set LANG = en_US.UTF-8
Change to LANG = zh_CN.gb2312

2. bash: ifconfig: command not found

Problem description:

Switch to the root user
[Root @ localhost/] $ ifconfig
Still prompt: "bash: ifconfig: command not found"

Whereis ifconfig

Method 1: [root @ localhost sbin] $/sbin/ifconfig
Method 2: [root @ localhost sbin] $ export PATH = $ PATH:/sbin. After this setting, you can directly access it next time, eliminating the first type of trouble.

Method 3: Modify the/etc/profile file and comment out the if statement.
Comment out the following if statement:
# Path manipulation
If ["$ EUID" = "0"]; then
Pathmunge/sbin
Pathmunge/usr/sbin
Pathmunge/usr/local/sbin
Fi
Change
# Path manipulation
# If ["$ EUID" = "0"]; then
Pathmunge/sbin
Pathmunge/usr/sbin
Pathmunge/usr/local/sbin
# Fi

3. redhat linux enters the command line after it is started.

Vi/etc/inittab id: 5: initdefault: change 5 in this sentence to 3.

4. Failed to install JDK in redhat

The following error occurs when installing the jdk-7u21-linux-i586.tar.gz in red hat enterprise linux5:

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

Solution:

Chcon-t textrel_shlib_t $ JAVA_HOME/jre/lib/i386/client/libjvm. so

5. Set the root permission for mysql remote connection

Mysql> Grant all privileges on *. * to 'root' @ '%' identified by 'Password' with grant option;
(% Indicates all external machines. If a specific machine is specified, change % to the corresponding machine name; 'root' indicates the user name to be used ,)
Mysql> flush privileges;

(Run this statement to take effect, or restart MySQL)

6. configure a static IP address in ubuntu

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

If the dynamic IP address is configured as follows:

# 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

7 install chkconfig in Ubuntu

There is no chkconfig command in Ubuntu and the chkconfig command is used by installing the chkconfig_11.0-79.1-2_all.deb.

8. Install ubuntu mysql

Install mysql-6.0.7-alpha-linux-i686-glibc23.tar.gz linux.

Groupadd mysql

Useradd-g mysql

Cd/usr/local

Gunzip </path/to/mysql-VERSION-OS.tar.gz | tar xvf-

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 'new 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. mysql garbled characters in linux

If mysql is used in linux, garbled characters may occur at noon. By querying the mysql replica set, you can find that latin1 needs to be modified.

Modify the/etc/my. cnf configuration file.

# 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 = 16 M

Max_allowed_packet = 1 M

Table_cache = 64

Sort_buffer_size = 512 K

Net_buffer_length = 8 K

Read_buffer_size = 256 K

Read_rnd_buffer_size = 512 K

Myisam_sort_buffer_size = 8 M

Default-character-set = utf8

After the database is restarted, view the region set information of the database again.

/Etc/init. d/mysql stop

/Etc/init. d/mysql start

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.