设为首页 收藏本站
查看: 663|回复: 0

[转]MySQL 5.1.56 for Windows XP/Vista/7

[复制链接]

尚未签到

发表于 2015-5-12 07:44:49 | 显示全部楼层 |阅读模式
MySQL 5.1.56 for Windows XP/Vista/7
Building a Web Server, for Windows
  http://www.devside.net/guides/windows/mysql
Requirements

  • None
Download

  • Package(win32 binary, non-installer version) : Select mysql-noinstall-5.1.56-win32.zip
Our Configuration

  • %SYSTEMROOT% : C:\Windows
  • Install to : C:\www\mysql
Setup

  • Unpack as C:\www\mysql-5.1.56-win32
  • Rename directory C:\www\mysql-5.1.56-win32 to C:\www\mysql
  • Copy MySQL configuration file C:\www\mysql\my-medium.ini (or your choice of one of the other included my-*.ini files) to your %SYSTEMROOT% directory
  • Rename file %SYSTEMROOT%\my-medium.ini (or the copied over my-*.ini file) to my.ini
  • Edit %SYSTEMROOT%\my.ini

    • Under Sections "[client]" and "[mysqld]", edit...

      • socket = C:/www/tmp/mysql.sock

    • Under Section "[mysqld]", insert...

      • basedir = C:/www/mysql/
      • datadir = C:/www/mysql/data/


MySQL Server Binaries
  MySQL ships with a number of server binaries to choose from. For standard/typical use and functionality, the preference is for server binary 'mysqld'.

  • mysqld.exe: Support for symbolic links, InnoDB and BDB transactional tables, and named pipes.
  • mysql-debug.exe: Compiled with full debugging and automatic memory allocation checking, symbolic links, and InnoDB and BDB transactional tables.
Startup
  MySQL can be installed as a Service (automatic or manual start-up) or started as a standalone console application. The MySQL server can be configured to listen (and communicate) on all interfaces (0.0.0.0), the loopback (127.0.0.1), or any other address. The MySQL server can also be configured to skip networking (TCP/IP) and/or connect via named-pipes (sockets).

  • Install the MySQL process as a Service.

    • [Default] Listen on all interfaces (0.0.0.0)...

      • For MySQL automatic start (but not this first time):mysqld --installOr for MySQL manual start only:mysqld --install-manual

    • Other options (edit my.ini), section '[mysqld]', insert...

      • Listen on loopback only (127.0.0.1)...
        bind-address=127.0.0.1
      • Do not use TCP/IP (IP addresses and ports) for connections, use named-pipes...
        bind-address=localhostskip-networkingenable-named-pipe[Note option socket=C:/www/tmp/mysql.sock (default is 'socket=MySQL' for mysql and php) under sections '[client]' and '[mysqld]'; Make sure the specifed dir exists; Make sure to fill php.ini options mysql.default_socket = C:/www/tmp/mysql.sock and mysql.default_host = localhost; Use mysql_connect('localhost:/www/tmp/mysql.sock', 'user', 'password')]

    • Start the MySQL Service...
      ...> NET START MySQL

  • Start MySQL as a standalone console application.

    • C:\www\mysql\bin> mysqld --standalone --console
    • [option '--standalone': Dummy option to start as a standalone server; can be omitted and have the same effect]
    • [option '--console': Write error output on screen (as opposed to error log)]
    • Other command line arguments...

      • IP address to bind to:--bind-address=127.0.0.1
      • Bypass TCP/IP with named pipes:--skip-networking --enable-named-pipe --socket=mysql.sock
      • [option '--skip-networking': do not use TCP/IP -- only valid for localhost]
      • [option '--enable-named-pipe': allows connections to other NT machines without being dependant on a specific network layer (TCP/IP or IPX)]
      • [option '--socket=...': name of nt-pipe/socket to use for option '--enable-named-pipe']


Cleanup

  • Create a password for the 'root' mysql account...

    • C:\www\mysql\bin> mysqladmin -u root password set-root-password-here

  • Delete all insecure users...

    • Access the MySQL prompt...

      • C:\www\mysql\bin> mysql -u root -p

    • Display all databases, accounts, and access controls to individual databases...

      • mysql> SHOW DATABASES;
      • mysql> SELECT User, Host, Password FROM mysql.user;
      • mysql> SELECT Host, Db, User, Select_priv FROM mysql.db;

    • Remove all initial accounts except 'root@localhost'; remove 'test' database and privileges set...

      • Remove anonymous users:mysql> DELETE FROM mysql.user WHERE User='';
      • Remove remote root:mysql> DELETE FROM mysql.user WHERE User='root' AND Host != 'localhost';
      • Remove test database:mysql> DROP DATABASE test;
      • Remove privileges on test database:mysql> DELETE FROM mysql.db WHERE Db = 'test' OR Db = 'test\\_%';
      • mysql> FLUSH PRIVILEGES;

    • Exit.

      • mysql> quit;


Running MySQL
  All commands are run from the command line and directory C:\www\mysql\bin (unless the mentioned dir is under the PATH)

  • Enter the command-line interface...
    > mysql -u root -p
  • Stop the MySQL Service (one of two ways)...
    > NET STOP MySQL
    > mysqladmin -u root -p shutdown
  • Uninstall the MySQL Service...
    > mysqld --remove
  • Shutdown the standalone console MySQL application (one of two ways)...
    > mysqladmin -u root -p shutdown[Note that this is done from another cmd.exe window]
    Ctrl-C under the cmd.exe window it was started from
Help
  All commands are run from the command line and directory C:\www\mysql\bin (unless the mentioned dir is under the PATH)

  • Display the MySQL command-line interface (shell) options...
    > mysql --help
  • Display mysqld options...
    > mysqld --help
  • Display MySQL version information...
    > mysqladmin -V
  • See what values a running MySQL server is using...
    > mysqladmin -u  -p variables
  • Display information...
    > mysqladmin -u  -p version status proc
  • Update password for MySQL user 'root' (from the MySQL shell)...
    mysql> UPDATE mysql.user SET Password=PASSWORD('root-password') WHERE User='root';
    mysql> FLUSH PRIVILEGES;

运维网声明 1、欢迎大家加入本站运维交流群:群②:261659950 群⑤:202807635 群⑦870801961 群⑧679858003
2、本站所有主题由该帖子作者发表,该帖子作者与运维网享有帖子相关版权
3、所有作品的著作权均归原作者享有,请您和我们一样尊重他人的著作权等合法权益。如果您对作品感到满意,请购买正版
4、禁止制作、复制、发布和传播具有反动、淫秽、色情、暴力、凶杀等内容的信息,一经发现立即删除。若您因此触犯法律,一切后果自负,我们对此不承担任何责任
5、所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其内容的准确性、可靠性、正当性、安全性、合法性等负责,亦不承担任何法律责任
6、所有作品仅供您个人学习、研究或欣赏,不得用于商业或者其他用途,否则,一切后果均由您自己承担,我们对此不承担任何法律责任
7、如涉及侵犯版权等问题,请您及时通知我们,我们将立即采取措施予以解决
8、联系人Email:admin@iyunv.com 网址:www.yunweiku.com

所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其承担任何法律责任,如涉及侵犯版权等问题,请您及时通知我们,我们将立即处理,联系人Email:kefu@iyunv.com,QQ:1061981298 本贴地址:https://www.yunweiku.com/thread-66029-1-1.html 上篇帖子: Windows Phone 7 创建自定义的控件 下篇帖子: 在windows 7上安装Maven2.2.1
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

扫码加入运维网微信交流群X

扫码加入运维网微信交流群

扫描二维码加入运维网微信交流群,最新一手资源尽在官方微信交流群!快快加入我们吧...

扫描微信二维码查看详情

客服E-mail:kefu@iyunv.com 客服QQ:1061981298


QQ群⑦:运维网交流群⑦ QQ群⑧:运维网交流群⑧ k8s群:运维网kubernetes交流群


提醒:禁止发布任何违反国家法律、法规的言论与图片等内容;本站内容均来自个人观点与网络等信息,非本站认同之观点.


本站大部分资源是网友从网上搜集分享而来,其版权均归原作者及其网站所有,我们尊重他人的合法权益,如有内容侵犯您的合法权益,请及时与我们联系进行核实删除!



合作伙伴: 青云cloud

快速回复 返回顶部 返回列表