mysql 配置问题 自用

5.7版本在解压后是没有data这个文件夹的,不要手动建立一个空的data文件夹,而是进入cmd,输入mysqld --initialize-insecure自动生成无密码的root用户,同时自动生成一个data文件夹,这时候再进行MySQL的安装,net start mysql,启动服务。
  如果你已经安装好了MySQL,那么先删除你手动建立的data文件夹,然后再输入mysqld --initialize-insecure【如果不输入-insecure会生成随机密码,第一次登陆会出现问题】,启动服务即可

\\安装命令    mysqld --install

C:\Program Files\MySQL\MySQL Server 5.6\bin>mysqld --install

\\删除服务命令     mysqld --remove mysql

D:\server\mysql\bin>mysqld --remove mysql

\\启动服务命令      net start mysql

D:\server\mysql\bin>net start mysql
MySQL 服务正在启动 .
MySQL 服务已经启动成功。

如果出现无法root 默认密码 无法登陆  1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)

\\ 先删除  mysqld --remove mysql

\\ 再删掉  mysql 里的data 文件夹

\\ 重启

\\ 安装 自定义指定mysql 路径: mysald --install mysql --defaults-file=D:\wamp64\bin\mysql\mysql5.7.24\my.ini

\\ 启动 net start mysql

**如遇到服务无法启动  服务没有报告任何错误。

\\ 查看 mysqld --console   有没有抛错误 【erro】.......

2019-07-01T08:38:23.214610Z 0 [Note] --secure-file-priv is set to NULL. Operations related to importing and exporting data are disabled
2019-07-01T08:38:23.214871Z 0 [Note] mysqld (mysqld 5.7.24) starting as process 3844 ...
2019-07-01T08:38:23.219654Z 0 [Note] InnoDB: Mutexes and rw_locks use Windows interlocked functions
2019-07-01T08:38:23.219975Z 0 [Note] InnoDB: Uses event mutexes
2019-07-01T08:38:23.220090Z 0 [Note] InnoDB: _mm_lfence() and _mm_sfence() are used for memory barrier
2019-07-01T08:38:23.220220Z 0 [Note] InnoDB: Compressed tables use zlib 1.2.11
2019-07-01T08:38:23.220526Z 0 [Note] InnoDB: Number of pools: 1
2019-07-01T08:38:23.220719Z 0 [Note] InnoDB: Not using CPU crc32 instructions
2019-07-01T08:38:23.222799Z 0 [Note] InnoDB: Initializing buffer pool, total size = 128M, instances = 1, chunk size = 128M
2019-07-01T08:38:23.227937Z 0 [Note] InnoDB: Completed initialization of buffer pool
2019-07-01T08:38:23.260472Z 0 [Note] InnoDB: Highest supported file format is Barracuda.
2019-07-01T08:38:23.349722Z 0 [Note] InnoDB: Creating shared tablespace for temporary tables
2019-07-01T08:38:23.350187Z 0 [Note] InnoDB: Setting file '.\ibtmp1' size to 12 MB. Physically writing the file full; Please wait ...
2019-07-01T08:38:23.487439Z 0 [Note] InnoDB: File '.\ibtmp1' size is now 12 MB.
2019-07-01T08:38:23.506583Z 0 [Note] InnoDB: 96 redo rollback segment(s) found. 96 redo rollback segment(s) are active.
2019-07-01T08:38:23.507339Z 0 [Note] InnoDB: 32 non-redo rollback segment(s) are active.
2019-07-01T08:38:23.509253Z 0 [Note] InnoDB: Waiting for purge to start
2019-07-01T08:38:23.561284Z 0 [Note] InnoDB: 5.7.24 started; log sequence number 2591497
2019-07-01T08:38:23.562250Z 0 [Note] Plugin 'FEDERATED' is disabled.
2019-07-01T08:38:23.562299Z 0 [Note] InnoDB: Loading buffer pool(s) from D:\wamp64\bin\mysql\mysql5.7.24\data\ib_buffer_pool
2019-07-01T08:38:23.578186Z 0 [Warning] Failed to set up SSL because of the following SSL library error: SSL context is not usable without certificate and private key
2019-07-01T08:38:23.578673Z 0 [Note] Server hostname (bind-address): '*'; port: 3306
2019-07-01T08:38:23.580014Z 0 [Note] IPv6 is available.
2019-07-01T08:38:23.580361Z 0 [Note]   - '::' resolves to '::';
2019-07-01T08:38:23.580764Z 0 [Note] Server socket created on IP: '::'.
2019-07-01T08:38:23.581107Z 0 [ERROR] Can't start server: Bind on TCP/IP port: No such file or directory
2019-07-01T08:38:23.581441Z 0 [ERROR] Do you already have another mysqld server running on port: 3306 ?
2019-07-01T08:38:23.581899Z 0 [ERROR] Aborting

2019-07-01T08:38:23.582331Z 0 [Note] Binlog end
2019-07-01T08:38:23.583287Z 0 [Note] Shutting down plugin 'ngram'
2019-07-01T08:38:23.583464Z 0 [Note] InnoDB: Buffer pool(s) load completed at 190701 16:38:23
2019-07-01T08:38:23.584188Z 0 [Note] Shutting down plugin 'partition'
2019-07-01T08:38:23.594705Z 0 [Note] Shutting down plugin 'BLACKHOLE'
2019-07-01T08:38:23.600013Z 0 [Note] Shutting down plugin 'ARCHIVE'
2019-07-01T08:38:23.605557Z 0 [Note] Shutting down plugin 'PERFORMANCE_SCHEMA'
2019-07-01T08:38:23.611202Z 0 [Note] Shutting down plugin 'MRG_MYISAM'
2019-07-01T08:38:23.616392Z 0 [Note] Shutting down plugin 'MyISAM'
2019-07-01T08:38:23.621986Z 0 [Note] Shutting down plugin 'INNODB_SYS_VIRTUAL'
2019-07-01T08:38:23.627339Z 0 [Note] Shutting down plugin 'INNODB_SYS_DATAFILES'
2019-07-01T08:38:23.632498Z 0 [Note] Shutting down plugin 'INNODB_SYS_TABLESPACES'
2019-07-01T08:38:23.638121Z 0 [Note] Shutting down plugin 'INNODB_SYS_FOREIGN_COLS'
2019-07-01T08:38:23.643611Z 0 [Note] Shutting down plugin 'INNODB_SYS_FOREIGN'
2019-07-01T08:38:23.648788Z 0 [Note] Shutting down plugin 'INNODB_SYS_FIELDS'
2019-07-01T08:38:23.653965Z 0 [Note] Shutting down plugin 'INNODB_SYS_COLUMNS'
2019-07-01T08:38:23.659536Z 0 [Note] Shutting down plugin 'INNODB_SYS_INDEXES'
2019-07-01T08:38:23.665075Z 0 [Note] Shutting down plugin 'INNODB_SYS_TABLESTATS'
2019-07-01T08:38:23.670193Z 0 [Note] Shutting down plugin 'INNODB_SYS_TABLES'
2019-07-01T08:38:23.675811Z 0 [Note] Shutting down plugin 'INNODB_FT_INDEX_TABLE'
2019-07-01T08:38:23.680824Z 0 [Note] Shutting down plugin 'INNODB_FT_INDEX_CACHE'
2019-07-01T08:38:23.685310Z 0 [Note] Shutting down plugin 'INNODB_FT_CONFIG'
2019-07-01T08:38:23.690008Z 0 [Note] Shutting down plugin 'INNODB_FT_BEING_DELETED'
2019-07-01T08:38:23.694555Z 0 [Note] Shutting down plugin 'INNODB_FT_DELETED'
2019-07-01T08:38:23.698876Z 0 [Note] Shutting down plugin 'INNODB_FT_DEFAULT_STOPWORD'
2019-07-01T08:38:23.703164Z 0 [Note] Shutting down plugin 'INNODB_METRICS'
2019-07-01T08:38:23.708191Z 0 [Note] Shutting down plugin 'INNODB_TEMP_TABLE_INFO'
2019-07-01T08:38:23.712706Z 0 [Note] Shutting down plugin 'INNODB_BUFFER_POOL_STATS'
2019-07-01T08:38:23.717151Z 0 [Note] Shutting down plugin 'INNODB_BUFFER_PAGE_LRU'
2019-07-01T08:38:23.721741Z 0 [Note] Shutting down plugin 'INNODB_BUFFER_PAGE'
2019-07-01T08:38:23.726491Z 0 [Note] Shutting down plugin 'INNODB_CMP_PER_INDEX_RESET'
2019-07-01T08:38:23.730766Z 0 [Note] Shutting down plugin 'INNODB_CMP_PER_INDEX'
2019-07-01T08:38:23.735050Z 0 [Note] Shutting down plugin 'INNODB_CMPMEM_RESET'
2019-07-01T08:38:23.739888Z 0 [Note] Shutting down plugin 'INNODB_CMPMEM'
2019-07-01T08:38:23.744497Z 0 [Note] Shutting down plugin 'INNODB_CMP_RESET'
2019-07-01T08:38:23.748783Z 0 [Note] Shutting down plugin 'INNODB_CMP'
2019-07-01T08:38:23.753121Z 0 [Note] Shutting down plugin 'INNODB_LOCK_WAITS'
2019-07-01T08:38:23.757905Z 0 [Note] Shutting down plugin 'INNODB_LOCKS'
2019-07-01T08:38:23.762648Z 0 [Note] Shutting down plugin 'INNODB_TRX'
2019-07-01T08:38:23.766472Z 0 [Note] Shutting down plugin 'InnoDB'
2019-07-01T08:38:23.770642Z 0 [Note] InnoDB: FTS optimize thread exiting.
2019-07-01T08:38:23.774677Z 0 [Note] InnoDB: Starting shutdown...
2019-07-01T08:38:23.879313Z 0 [Note] InnoDB: Dumping buffer pool(s) to D:\wamp64\bin\mysql\mysql5.7.24\data\ib_buffer_pool
2019-07-01T08:38:23.886030Z 0 [Note] InnoDB: Buffer pool(s) dump completed at 190701 16:38:23
2019-07-01T08:38:24.915756Z 0 [Note] InnoDB: Shutdown completed; log sequence number 2591516
2019-07-01T08:38:24.917742Z 0 [Note] InnoDB: Removed temporary tablespace data file: "ibtmp1"
2019-07-01T08:38:24.918960Z 0 [Note] Shutting down plugin 'MEMORY'
2019-07-01T08:38:24.922632Z 0 [Note] Shutting down plugin 'CSV'
2019-07-01T08:38:24.926732Z 0 [Note] Shutting down plugin 'sha256_password'
2019-07-01T08:38:24.931078Z 0 [Note] Shutting down plugin 'mysql_native_password'
2019-07-01T08:38:24.935599Z 0 [Note] Shutting down plugin 'binlog'
2019-07-01T08:38:24.940524Z 0 [Note] mysqld: Shutdown complete

已知上面错误!  说明3306端口被占用:

2019-07-01T08:38:23.581107Z 0 [ERROR] Can't start server: Bind on TCP/IP port: No such file or directory
2019-07-01T08:38:23.581441Z 0 [ERROR] Do you already have another mysqld server running on port: 3306 ?
2019-07-01T08:38:23.581899Z 0 [ERROR] Aborting

 

更改配置文件 my.ini  把端口号 改未被占用的

[client]
port            = 3307
# …
# …
[mysqld]
# …
port            = 3307
# …


\\ 之后 便可启动了
 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值