MYSQL--服务器的安装

时间:2025-04-14 18:07:31

          MYSQL--服务器的安装

  学java已经好久了,但是还是没有学会安装数据库,这次重装系统后自己学了学,昨天晚上刚刚装好,卸载了,再装一次,就想着把它笔记下来。要不又忘了。。

    MYSQL--服务器的安装

  1.删除你的服务。在cmd中输入net stop mysql //停止服务  sc delete mysql//删除服务(这里就删除了你的mysql服务器了)

                mysql-nt-remove //删除服务

                mysqld-max-nt -remove 删除目录

    MYSQL--服务器的安装

  2.进入你的目录下,如果没有目录的话可以下载一个MYSQL的解压包,解压完成后,在你的解压目录下添加一个名为 my.ini的服务。如果又得话进入你得目录,删除data中得东西,删空。

    MYSQL--服务器的安装

  再看看my.ini得内容:

    MYSQL--服务器的安装

  

[client]
port=3306 [mysql]
default-character-set=utf8 [mysqld]
port=3306
basedir="D:\SoftWare\MYSQL\mysql\mysql-5.7.19-winx64\"
datadir="D:\SoftWare\MYSQL\mysql\mysql-5.7.19-winx64\data"
character-set-server=utf8 [WinMySQLadmin]
Server="D:\SoftWare\MYSQL\mysql\mysql-5.7.19-winx64\bin\mysqld.exe"
default-character-set=utf8
default-storage-engine=INNODB
sql-mode="STRICT_TRANS_TABLES,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION" max_connections=100
query_cache_size=0
table_cache=256
tmp_table_size=26M
thread_cache_size=8
myisam_max_sort_file_size=100G
myisam_sort_buffer_size=52M key_buffer_size=40M
read_buffer_size=64K
read_rnd_buffer_size=256K sort_buffer_size=256K # Use this option if you have a MySQL server withInnoDB support enabled # but you do not plan to use it. This will save memoryand disk space # and speed up some things. #skip-innodb # Additional memory pool that is used by InnoDB tostore metadata # information. If InnoDB requires more memory for this purpose it will # start to allocate it from the OS. As this is fast enough on most # recent operating systems, you normally do not needto change this # value. SHOW INNODB STATUS will display the currentamount used. innodb_additional_mem_pool_size=2M
innodb_flush_log_at_trx_commit=1
innodb_log_buffer_size=1M
innodb_buffer_pool_size=77M
innodb_log_file_size=39M
innodb_thread_concurrency=8

  在cmd中进入到你得MySQL目录下,输入命令   msyqld --initialize --console  ,

   MYSQL--服务器的安装

  然后输入 mysqld install .然后启动服务器  net start mysql

    MYSQL--服务器的安装

    添加一个root用户。然后更密码。

    MYSQL--服务器的安装

  然后服务就回来了。。

    MYSQL--服务器的安装

    ok!!! MYSQL得服务器就好了。