77范文网 - 专业文章范例文档资料分享平台

Archlinux安装MySQL的正确方法

来源:网络收集 时间:2020-04-21 下载这篇文档 手机版
说明:文章内容仅供预览,部分内容可能不全,需要完整文档或者需要复制内容,请下载word后使用。下载word有问题请添加微信号:或QQ: 处理(尽可能给您提供完整文档),感谢您的支持与谅解。点击这里给我发消息

Archlinux安装MySQL的正确方法,解决root密码错误问题

网上的资料竟然没有一个是对的,包括arch linux官方给的都不对, 更要命的是安装mysql时系统给的提示都不对。我google了关于中文arch linux安装mysql的问档,最新的也是去年的。 可今年都过了一半了。 于是我又不得不搜索了英文网站。总算找到一个还算行的通的方法,但是这个老外给的也不完全对,有一个步骤没给导致了mysql不能启动。 这里我把正确的方法帖出来。我用的是最新的arch linux2009.02版。

如果你已经安装了mysql,经过多次设置root密码还是失败, 那么你最好还是从头开始,把已经装好的mysql删除。但是如果还没安装的可以直接从第3步开始。 另外,我用的是root帐号, 普通的帐号自己加sudo。

1。#移除已经安装的mysql数据库文件 #rm -r /var/lib/mysql 2。移除mysql #pacman -Rn mysql 3. 安装mysql #pacman -S mysql 4. 初始化数据库 #/usr/bin/mysql_install_db

5. 老外也没给的步骤就是这一步了, 初始化数据库后 /var/lib/mysql是属于root的, mysql没法写,所以改属主

#

chown -R mysql:mysql /var/lib/mysql 6。mysql初始化

#/usr/bin/mysql_secure_installation

完毕后就可以用mysql -u root -p来登录了。 根本不是用什么mysqladmin来初始化密码。 当然这仅仅限于arch linux.

arch linux速度是比ubuntu server快些。因为去掉了很多不必要的东西。 如果自己配制linux内核,应该会有更快的速度。

? su -

? pacman -S mysql mysql-gui-tools

? run mysql_install_db –user=mysql in /var/lib/mysql

? vim /etc/my.cnf, disable skip_networking to allow tcp/ip connection ? vim /etc/hosts.allow, add mysql:all:allow ? /etc/rc.d/mysql start

? mysqladmin -u root password #NEW_PASSWORD# to set root password

Introduction

MySQL is a widely spread, multi-threaded, multi-user SQL database. For more information about features, see theofficial homepage.

Installation

Install the mysql package: # pacman -S mysql

After installing MySQL you should run arch's init script as root: # /etc/rc.d/mysqld start

This will take care of the basic configuration as adding system users and creating log files. This script also prints out how to configure MySQL after the first start.

Configuration

Once you've started the MySQL server, you probably want to add a root account in order to maintain your MySQL users and databases. This can be done manually or automatically, as mentioned by the output of the above script. Either run the commands to set a password for the root account, or run the secure installation script.

You now should be able to do further configuration using your favorite interface. For example you can use MySQL's command line tool to login as root into your MySQL server:

$ mysql -p -u root

To start MySQL at bootup add mysqld

to the list of daemons in /etc/rc.conf or add

/etc/rc.d/mysqld start to /etc/rc.local

.

The MySQL server does not listen on the TCP port 3306 by default. To allow (remote) TCP connections, comment the line containing 'skip-networking' in /etc/my.cnf. Remember to edit /etc/hosts.allow by adding the following line:

mysqld: ALL Troubleshooting

How to Reset the Root Password Stop mysqld daemon

# /etc/rc.d/mysqld stop # mysqld_safe --skip-grant-tables & Connect to mysql server # mysql -u root mysql Change root password:

mysql> UPDATE user SET password=PASSWORD(\User='root'; mysql> FLUSH PRIVILEGES; mysql> exit

Then restart daemon: # /etc/rc.d/mysqld restart You're done

WHERE

百度搜索“77cn”或“免费范文网”即可找到本站免费阅读全部范文。收藏本站方便下次阅读,免费范文网,提供经典小说综合文库Archlinux安装MySQL的正确方法在线全文阅读。

Archlinux安装MySQL的正确方法.doc 将本文的Word文档下载到电脑,方便复制、编辑、收藏和打印 下载失败或者文档不完整,请联系客服人员解决!
本文链接:https://www.77cn.com.cn/wenku/zonghe/1002767.html(转载请注明文章来源)
Copyright © 2008-2022 免费范文网 版权所有
声明 :本网站尊重并保护知识产权,根据《信息网络传播权保护条例》,如果我们转载的作品侵犯了您的权利,请在一个月内通知我们,我们会及时删除。
客服QQ: 邮箱:tiandhx2@hotmail.com
苏ICP备16052595号-18
× 注册会员免费下载(下载后可以自由复制和排版)
注册会员下载
全站内容免费自由复制
注册会员下载
全站内容免费自由复制
注:下载文档有可能“只有目录或者内容不全”等情况,请下载之前注意辨别,如果您已付费且无法下载或内容有问题,请联系我们协助你处理。
微信: QQ: