网创优客建站品牌官网
为成都网站建设公司企业提供高品质网站建设
热线:028-86922220
成都专业网站建设公司

定制建站费用3500元

符合中小企业对网站设计、功能常规化式的企业展示型网站建设

成都品牌网站建设

品牌网站建设费用6000元

本套餐主要针对企业品牌型网站、中高端设计、前端互动体验...

成都商城网站建设

商城网站建设费用8000元

商城网站建设因基本功能的需求不同费用上面也有很大的差别...

成都微信网站建设

手机微信网站建站3000元

手机微信网站开发、微信官网、微信商城网站...

建站知识

当前位置:首页 > 建站知识

mysql文件怎么初始化 如何初始化mysql数据库

MySQL5.7数据库怎么初始化

1、双击进入安装 2、在协议许可(License Agreement)界面,勾选“I accept the license terms”,点击“Next”。 3、在检查更新信息(Find latest products)界面,勾选“Skip the check for updates(no re中国mended)”跳过检查,然后点击“Next”。 4、在选择安装类型(Choosing a Setup Type)界面,根据安装需求选择安装类型(推荐默认开发版本),设置MySQL安装路径和数据存放路径,最后点击“Next”。 5、在检查要求(Check Requirements)界面,点击“Next”。 6、安装进度(Installation progress)界面,点击“Execute”执行。 7、等待安装进度完毕,点击“Next”。 8、进入配置概述(Configuration Overview)界面,点击“Next”。 9、在MySQL服务配置(MySQL Server Configuration)界面,默认不做修改,点击“Next”。 10、设置根账户(root账户)密码。 11、添加(非根)用户账户。其目的是便于数据库权限管理,为远程访问者提供安全账户。

为乳源等地区用户提供了全套网页设计制作服务,及乳源网站建设行业解决方案。主营业务为成都网站建设、成都网站制作、乳源网站设计,以传统方式定制建设网站,并提供域名空间备案等一条龙服务,秉承以专业、用心的态度为用户提供真诚的服务。我们深信只要达到每一位用户的要求,就会得到认可,从而选择与我们长期合作。这样,我们也可以走得更远!

如何初始化MySQL数据库

1、停止mysql服务

2、删除mysql的data目录下的,除mysql这个目录外的其他目录(为保险期间,先移走)

3、重启myql即可

-----------------------------------

呵呵,放松,一切都会好起来的!

如何初始化mysql数据

一、mysql_install_db说明

当MySQL的系统库(mysql系统库)发生故障或需要新加一个mysql实例时,需要初始化mysql数据库。

需要使用的命令:/usr/local/mysql/bin/mysql_install_db

#/usr/local/mysql/bin/mysql_install_db --help 可以查看帮助信息如下

Usage: /usr/local/mysql/bin/mysql_install_db [OPTIONS]

--basedir=path The path to the MySQL installation directory.

--cross-bootstrap For internal use. Used when building the MySQL system

tables on a different host than the target.

--datadir=path The path to the MySQL data directory.

--force Causes mysql_install_db to run even if DNS does not

work. In that case, grant table entries that normally

use hostnames will use IP addresses.

--ldata=path The path to the MySQL data directory.

--rpm For internal use. This option is used by RPM files

during the MySQL installation process.

--skip-name-resolve Use IP addresses rather than hostnames when creating

grant table entries. This option can be useful if

your DNS does not work.

--srcdir=path For internal use. The directory under which

mysql_install_db looks for support files such as the

error message file and the file for popoulating the

help tables.

--user=user_name The login username to use for running mysqld. Files

and directories created by mysqld will be owned by this

user. You must be root to use this option. By default

mysqld runs using your current login name and files and

directories that it creates will be owned by you.

All other options are passed to the mysqld program

除了支持以上的参数,还支持mysqld的参数。

二、举例:

本文以新加一个mysql实例为例。例如服务器上已经安装了3306端口的mysql服务,需要再启一个3308端口的mysql服务。

假设mysql安装在/usr/local/mysql路径下,找一个磁盘空间剩余比较大的盘,如/data1,把3308端口的mysql的数据保存在/data1下

#mkdir /data1/mysql_3308

#mkdir /data1/mysql_3308/data

#chown -R mysql:mysql /data1/mysql_3308

复制一个mysql配置文件my.cnf到/data1/mysql_3308目录下

#vi /data1/mysql_3308/my.cnf

修改配置文件,将端口和相关目录的都改为新的设置,如下:

[client]

character-set-server = utf8

port = 3308

socket = /tmp/mysql_3308.sock

[mysqld]

user = mysql

port = 3308

socket = /tmp/mysql_3308.sock

basedir = /usr/local/mysql

datadir = /data1/mysql_3308/data

log-error = /data1/mysql_3308/mysql_error.log

pid-file = /data1/mysql_3308/mysql.pid

......其他略

确保配置文件无误。

运行下面命令进行数据库的初始化:

#/usr/local/mysql/bin/mysql_install_db --defaults-file=/data1/mysql_3308/my.cnf --datadir=/data1/mysql_3308/data

完成后新的3308数据库就初始化好了,如果有报错,则按照报错的提示查看报错日志,一般情况下都是my.cnf配置文件的问题,修正后即可。

三、启动新mysql

启动3308端口的mysql服务

#/usr/local/mysql/bin/mysqld_safe --defaults-file=/data1/mysql_3309/my.cnf

检查是否启动

#ps aux|grep mysql

如果有3308字样说明已经启动成功

可将启动命令加入/etc/rc.local随服务器启动

新加的mysql没有设置root密码,可以通过下面命令设置root密码:

#/usr/local/mysql/bin/mysqladmin -S /tmp/mysql_3308.sock -u root password 'new-password'

centos mysql 怎么初始化

使用的命令:mysql_install_db,用于初始化mysql的数据库,生成元数据。

若不加任何参数,则该命令按照/etc/my.cnf文件配置执行初始化工作,否则可参照如下帮助手动执行参数。

$ mysql_install_db --help 可以查看帮助信息如下

Usage: /usr/local/mysql/bin/mysql_install_db [OPTIONS]

--basedir=path The path to the MySQL installation directory.

--cross-bootstrap For internal use. Used when building the MySQL system

tables on a different host than the target.

--datadir=path The path to the MySQL data directory.

--force Causes mysql_install_db to run even if DNS does not

work. In that case, grant table entries that normally

use hostnames will use IP addresses.

--ldata=path The path to the MySQL data directory.

--rpm For internal use. This option is used by RPM files

during the MySQL installation process.

--skip-name-resolve Use IP addresses rather than hostnames when creating

grant table entries. This option can be useful if

your DNS does not work.

--srcdir=path For internal use. The directory under which

mysql_install_db looks for support files such as the

error message file and the file for popoulating the

help tables.

--user=user_name The login username to use for running mysqld. Files

and directories created by mysqld will be owned by this

user. You must be root to use this option. By default

mysqld runs using your current login name and files and

directories that it creates will be owned by you.

如何初始化MySQL数据库在Ubuntu安装后

当在Ubuntu中执行命令sudo apt-get install mysql-server5.1安装的时候居然没有提示我输入mysql的密码之类的信息,但是当安装好之后再终端中直接输入mysql的时候又能直接进入mysql中,虽然可以进入mysql中但是我对mysql的密码一点都不知道,所以这个时候安装的mysql就相当于没有安装,因为不能用程序进行操作mysql数据库(因为操作数据库都需要mysql数据的密码的),为了解决ubuntu中mysql密码初始化的方法有一下两种:

(1)打开/etc/mysql/debian.cnf文件,在这个文件中有系统默认给我们分配的用户名和密码,通过这个密码就可以直接对mysql进行操作了。但是一般这个密码都比较怪,很长很长。

(2)当进入mysql之后修改mysql的密码:这个方法比较好,具体的操作如下用命令:set password for 'root'@'localhost' = password('yourpass');当修改之后就可应正常对mysql进行操作了。

sql数据库数据如何初始化

初始化mysql数据库,在shell中运行以下命令:

cd /usr/local/mysql

mkdir sock

cd /usr/local/mysql/bin

初始化数据库

./mysql_install_db--user=mysql --basedir=/usr/local/mysql --datadir=/usr/local/mysql/data

或者# mysqld --initialize


网页题目:mysql文件怎么初始化 如何初始化mysql数据库
浏览地址:http://bjjierui.cn/article/hgdscp.html

其他资讯