`

Install MySQL for Database Server

 
阅读更多

[root@www ~]# yum -y install mysql-server
[root@www ~]# /etc/rc.d/init.d/mysqld start 
Initializing MySQL database:  Installing MySQL system tables...
OK
Filling help tables...
OK

To start mysqld at boot time you have to copy
support-files/mysql.server to the right place for your system

PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !
To do so, start the server, then issue the following commands:

/usr/bin/mysqladmin -u root password 'new-password'
/usr/bin/mysqladmin -u root -h www.server.world password 'new-password'

Alternatively you can run:
/usr/bin/mysql_secure_installation

which will also give you the option of removing the test
databases and anonymous user created by default.  This is
strongly recommended for production servers.

See the manual for more instructions.

You can start the MySQL daemon with:
cd /usr ; /usr/bin/mysqld_safe &

You can test the MySQL daemon with mysql-test-run.pl
cd /usr/mysql-test ; perl mysql-test-run.pl

Please report any problems with the /usr/bin/mysqlbug script!

Starting mysqld:     [  OK  ]

[root@www ~]# chkconfig mysqld on 
[root@www ~]# mysql -u root # connect to MySQL
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 2
Server version: 5.1.52 Source distribution

Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
This software comes with ABSOLUTELY NO WARRANTY. This is free software,
and you are welcome to modify and redistribute it under the GPL v2 license

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

# show user info
mysql> select user,host,password from mysql.user; 

# set root password
mysql> set password for root@localhost=password('password'); 
Query OK, 0 rows affected (0.00 sec)
# set root password
mysql> set password for root@'127.0.0.1'=password('password'); 
Query OK, 0 rows affected (0.00 sec)
# set root password
mysql> set password for root@'www.server.world'=password('password'); 
Query OK, 0 rows affected (0.00 sec)
# delete anonymous user
mysql> delete from mysql.user where user=''; 
Query OK, 2 rows affected (0.00 sec)
mysql> select user,host,password from mysql.user;

mysql> exit # quit
Bye
[root@www ~]# mysql -u root -p # connect with root
Enter password:# MySQL root password
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 4
Server version: 5.1.52 Source distribution

Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
This software comes with ABSOLUTELY NO WARRANTY. This is free software,
and you are welcome to modify and redistribute it under the GPL v2 license
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> exit
Bye
 
分享到:
评论

相关推荐

    MySQL for Python 2010.pdf

    Explore the various means to install MySQL for Python, from using an egg to unrolling a tarball Query the database and retrieve records through MySQL for Python Implement insertion of data into a ...

    在Ubuntu14.04上离线安装mysql5.7.19时需要的两个依赖包

    dpkg: error processing package mysql-community-server (--install): dependency problems - leaving unconfigured Processing triggers for man-db (2.6.7.1-1ubuntu1) ... Processing triggers for ureadahead ...

    PHP & MySQL in easy steps: Covers MySQL 8.0

    PHP and MySQL in easy steps, 2nd edition begins by explaining how to install a free web server, the PHP interpreter, and MySQL database server, to create an environment in which you can produce your ...

    MySQL 4th Edition 第四版

    Paul DuBois and his editors at New Riders have assembled MySQL with a clarity and lucidity that inspires confidence in the subject matter: a (nearly) freely redistributable SQL-interpreting database ...

    MySQL V5.5帮助文档

    1.3. Overview of the MySQL Database Management System 1.3.1. What is MySQL? 1.3.2. History of MySQL 1.3.3. The Main Features of MySQL 1.4. MySQL Development History 1.5. What Is New in MySQL 5.5 1.5.1...

    mysql-5.5.14.tar.gz

    ./scripts/mysql_install_db --user=mysql /usr/local/mysql/bin/mysqld_safe --user=mysql & /usr/local/mysql/bin/mysql Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL ...

    Database design & Database deployment software BDB 2007 Professional V2.3

    It suppots such database as Oralce,MS SQLServer,MySQL,Access,SQLAnywhere and Sybase. Through the BDB you can quickly build up a database model and do two-way synchronization entities with the ...

    Database design & Database deployment software BDB 2007 Developer V2.3

    It suppots such database as Oralce,MS SQLServer,MySQL,Access,SQLAnywhere and Sybase. Through the BDB you can quickly build up a database model and do two-way synchronization entities with the ...

    MYSQL

    Apache一起使用 MySQL 18 问题和常见的错误 18.1 如果 MySQL总是崩溃怎么办 18.2 使用 MySQL 时一些常见错误 18.2.1 MySQL server has gone away错误 18.2.2 Can't connect to [local] MySQL ...

    24小时教会PHP, MySQL and Apache(英文)

    The book teaches the reader to install, configure and set up the PHP scripting language, the MySQL database system, and the Apache Web server. By the end of this book the reader will understand how ...

    MySQL中文参考手册.chm

    4.13 OS/2 注意事项 4.14 TcX 二进制代码 4.15 安装后期(post-installation)的设置与测试 4.15.1 运行mysql_install_db 的问题 4.15.2 启动 MySQL 服务器的问题 4.15.3 自动启动和停止...

    MYSQL培训经典教程(共两部分) 1/2

    数据库的基本操作 46 3.1 MYSQL的启动与终止 47 3.1.1 直接运行守护程序 47 3.1.2 使用脚本mysql.server启动关闭数据库 48 3.1.3 使用mysqladmin实用程序关闭、重启数据库 49 3.1.4 启动或停止NT平台...

    MySQL中文参考手册

    + 4.15.1 运行mysql_install_db 的问题 + 4.15.2 启动 MySQL 服务器的问题 + 4.15.3 自动启动和停止 MySQL + 4.15.4 选项文件 o 4.16 升级和降级(downgrading)时有什么特别要做的事情吗? + 4.16.1 从一个 ...

    Linux服务器搭建之六:mysql数据库服务器.doc

    在root账户里安装mysql-server服务器:【yum -y install mysql-server】" " " " " "昨天 17:07 上传 " "下载附件 (113.47 KB) " " " " " " " " " " " "3.安装成功,看看吧,yum会自动安装与mysql-server软件包相关...

    mysql示例数据库 employee

    You need a MySQL database server (5.0+) and run the commands below through a user that has the following privileges: SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, RELOAD, REFERENCES, INDEX, ALTER, ...

    node-socket-imageServer:一个简单的图像服务器,它从 Mysql DB 加载图像并在客户端连接 socket.io 时发送它

    mysql > create database chatserver ; mysql > create user ' chat ' @ ' localhost ' identified by ' chat123 ' ; mysql > grant all privileges on chatserver. * to ' chat ' @ ' localhost ' ; mysql > exit ...

    mysql-redis-sync-utility:MySQL 到 Redis 缓存同步实用程序

    安装 $ sudo apt-get install python-setuptools $ sudo easy_install pip $ sudo pip install mysql-replication ...mysql > create database contact ; mysql > use contact ; mysql > create table contacti

    mysql5.5.6安装教程及安装包.rar

    10、在出现的配置界面中选择mysql数据库的用途,“Multifunctional Database(通用多功能型)”、“Transactional Database Only(服务器类型)”、“Non-Transactional Database Only(非事务处理型)”,这里我...

    mysqlmtop:MySQL监控系统

    安装说明(以ubuntu14.04为例)1,安装LAMP环境sudo apt-get install lamp-server^2,安装python环境系统已经安装python2.7,需要安装mysql-python,采用pip进行安装sudo apt-get install python-pip python-devsudo...

    Python 基于 opencv 的车牌识别系统,可作为毕业设计.zip

    毕业设计基于Opencv的车牌识别系统 1 实现功能 ...mysql.server start --skip-grant-tables mysql -uroot CREATE USER 'python'@'%' IDENTIFIED BY 'Python12345@'; CREATE database chepai; GRA

Global site tag (gtag.js) - Google Analytics