Ubuntu under MySQL connection (reprint)

Source: Internet
Author: User
Tags mysql host

Ubuntu under MySQL default only from locally connected solution


sudo gedit/etc/mysql/my.cnf
Modify a field
Bind-address = 127.0.0.1
-
Bind-address=xxx.xxx.xxx.xxx (Your IP)
(FROM:HTTP://HI.BAIDU.COM/VINCENT_HCL)



First, connect MySQL.
Format: mysql-h host address-u user name-P user Password
1. Example 1: Connect to MySQL on this machine.
First open the DOS window, then enter the directory Mysqlbin, and then type the command mysql-uroot-p, enter after you are prompted

Password, if you just installed MySQL, superuser root is no password, so directly enter into MySQL

, the prompt for MySQL is:mysql>
2. Example 2: Connect to MySQL on the remote host. Assume that the IP of the remote host is: 110.110.110.110, the user name is

Root, the password is abcd123. Type the following command:
Mysql-h110.110.110.110-uroot-pabcd123
(Note: You and root can be used without spaces, others are the same)
3. Exit MySQL command: Exit (enter)
Second, change the password.
Format: Mysqladmin-u username-P Old password password new password
1, Example 1: Add a password to root ab12. First enter directory Mysqlbin under DOS, and then type the following command
Mysqladmin-uroot-password AB12
Note: Because Root does not have a password at the beginning, the-p old password can be omitted.
2, Example 2: Then change the root password to djg345.
MYSQLADMIN-UROOT-PAB12 Password djg345
Third, add new users. (Note: Unlike the above, this is because it is a command in the MySQL environment, so it is followed by a

Semicolon as a command terminator)
Format: Grant Select on database. * To User name @ login host identified by "password"
Example 1, add a user test1 password for ABC, so that he can log on any host, and all databases have queries,

The permission to insert, modify, or delete. First, use the root user to connect to MySQL, and then type the following command:
Grant Select,insert,update,delete on * * to [e-mail protected] "%" identified by "ABC";
But example 1 increases the user is very dangerous, you want to like someone to know test1 password, then he can in the Internet

Log on to your MySQL database on any computer and do whatever you can with your data, see Example 2 for a workaround.
Example 2,
Add a user test2 password to ABC, so that he can only login on localhost, and can check the database mydb

Actions to inquire, insert, modify, delete
(localhost refers to the local host, which is the host where the MySQL database resides), so that the user is using a secret that knows Test2

Access to data directly from the Internet
Library, which can only be accessed through a Web page on a MySQL host.
Grant Select,insert,update,delete on mydb.* to [email protected] identified by

"ABC";
If you do not want to test2 have a password, you can call another command to erase the password.
Grant Select,insert,update,delete on mydb.* to [email protected] identified by

[...]


Network configuration under Ubuntu Server version
Lesson...................
The network was not configured at the time of installation, all the way Ok,lamp server,mail server and Pgsql loaded up
Into the system, the problem will come out, haha, not on the net, on the Web server what is called?
Now start to configure the network card, Ifconfig looked down, eth0 address is not configured
$sudo pico/etc/network/interfaces
This launches a simple text editor to edit the Linux network configuration file
Here you should see something like this:
Auto Lo
Iface Lo inet Loopback
This is the LO loopback, and I need to have the Ubuntu server run with a static IP to join the network, then I just need to add the above lo loopback configuration:
Auto Eth0
Iface eth0 inet Static
Address 192.168.1.10
Netmask 255.255.255.0
Gateway 192.168.1.1
If your network device supports DHCP, then configure it like this:
Auto Eth0
Iface Etho inet DHCP
Press the Ctrl+o key to save and press Ctrl+x to exit.
And then, run: $sudo/ect/init.d/networking restart
Just show reconfiguring network interfaces ...
The network component is successfully restarted.
Ifconfig look at it again? Did your eth0 change? Oh
This way, we can surf the Internet.

Ubuntu Server Installation Xiang Solution

System software: Ubuntu 7.04 kernel, fluxbox desktop management, Firefox browser, OpenOffice Office software, xfe file Manager



STEP1: Installing Ubuntu 7.04 Server

A, Server Installation screen, press F6, before--add "irqpoll" option; Press F4 to select a screen resolution of 1024x768 32

B, Language choice 中文版

C. Select "Cancel" to save system installation time when automatic DHCP setting is installed

D, manual hard disk partition, create a 65MB partition, and set its mount point to/boot,bootable option set to True, if not set, the system can not be started after installation

E, Server installation type, lamp selection

F, installation process about 15 minutes



Step 2: Set up the network

A, dynamic IP:

sudo nano/etc/network/interfaces added at the end of the file



Iface eth0 inet DHCP

Auto Eth0



b, static IP: (speed up the boot speed)

Iface eth0 inet Static

Address 192.168.0.3

Netmask 255.255.255.0

Gateway 192.168.0.1

Auto Eth0



Note: The IP address is set to 192.168.0.3, subnet mask: 255.255.255.0, Gateway: 192.168.0.1



Press Ctrl+o to save the file and press Ctrl+x to exit



Set DNS (dynamic IP not required)

sudo nano/etc/resolv.conf in file join



NameServer 192.168.0.1

Note: 192.168.0.1 is the IP address of the DNS



Press Ctrl+o to save the file and press Ctrl+x to exit



Step 3, restart the system network



sudo/etc/init.d/networking restart



Step 4, modify the source



Get a copy of a file or edit it manually from the Web



A. Get a source copy file from the Internet

wget http://www.topmiracle.net/sources.list

Ubuntu under MySQL connection (reprint)

Related Article

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.