﻿<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/"><channel><title>IT博客-玄铁剑-文章分类-MySql</title><link>http://www.cnitblog.com/MartinYao/category/8856.html</link><description>成功的途径：抄，创造，研究，发明...</description><language>zh-cn</language><lastBuildDate>Mon, 26 Sep 2011 06:31:00 GMT</lastBuildDate><pubDate>Mon, 26 Sep 2011 06:31:00 GMT</pubDate><ttl>60</ttl><item><title>MySql error nr.1364 (Apply security settings)</title><link>http://www.cnitblog.com/MartinYao/articles/73311.html</link><dc:creator>玄铁剑</dc:creator><author>玄铁剑</author><pubDate>Sun, 10 Apr 2011 12:58:00 GMT</pubDate><guid>http://www.cnitblog.com/MartinYao/articles/73311.html</guid><wfw:comment>http://www.cnitblog.com/MartinYao/comments/73311.html</wfw:comment><comments>http://www.cnitblog.com/MartinYao/articles/73311.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cnitblog.com/MartinYao/comments/commentRss/73311.html</wfw:commentRss><trackback:ping>http://www.cnitblog.com/MartinYao/services/trackbacks/73311.html</trackback:ping><description><![CDATA[<h1>MySQL 5.5.9 Installation Problem</h1>
&lt;&gt;http://www.opensourcevarsity.com/mysqlbasics/mysqlinstall<br><br>Prior Installing MySQL on Local Windows&lt;&gt;
<ol>
    <li>Disconnect the machine from any <a style="POSITION: static; FONT-FAMILY: inherit !important; TEXT-DECORATION: underline !important" id=KonaLink1 href="http://www.opensourcevarsity.com/#"><font style="POSITION: static; FONT-FAMILY: inherit !important; COLOR: green !important" color=green><span style="BORDER-BOTTOM: green 1px solid; POSITION: static; BACKGROUND-COLOR: transparent; FONT-FAMILY: inherit !important; COLOR: green !important">network</span></font></a> (if it is on any Local Area Network), isolate the machine</li>
    <li>Stop or Disable any antivirus setup running on the local machine ( which is why the machine must be isolated)</li>
    <li>Set the Windows Firewall - OFF. Stop all windows security on the local machine.</li>
</ol>
<p>Navigate to the folder where the MySQL <strong>.</strong>msi which is the MySQL installer exists.</p>
<p>Run the <strong>.</strong>msi to setup MySQL Server 5.5.9 by double clicking it.</p>
<p>For the installation steps, refer to tutorial <a href="http://www.opensourcevarsity.com/mysqlbasics/l3mysqlinstallation" target=_blank><font color=#37708b>MySQL Installation</font></a> which is covered on this website.</p>
<p>Right at the very end of the install / configuration process, the following will happen<strong>:</strong></p>
<ol>
    <li>Preparation configuration &#8211; successful</li>
    <li>Configuration file written &#8211; successfully </li>
    <li>The MySQL Server Instance service started &#8211; successfully </li>
</ol>
<p>BUT</p>
<ul>
    <li><strong>When applying security settings the configuration process will fail</strong></li>
</ul>
<p><strong>NOTE:</strong> There is a bug in Version 5.8.8 that prevents security <a style="POSITION: static; FONT-FAMILY: inherit !important; TEXT-DECORATION: underline !important" id=KonaLink2 href="http://www.opensourcevarsity.com/#"><font style="POSITION: static; FONT-FAMILY: inherit !important; COLOR: green !important" color=green><span style="BORDER-BOTTOM: green 1px solid; POSITION: static; BACKGROUND-COLOR: transparent; FONT-FAMILY: inherit !important; COLOR: green !important">application</span></font></a> to the MySQL instance.</p>
<p>The following window will appear during the MySQL 5.5.9 installation process as shown in Diagram 1.</p>
<p>The Error Message is as shown in diagram 1.</p>
<p><strong>&#8220;The security settings could not be applied to the database because the connection has failed with following error. Error Nr:1364Field &#8216;authentication_string&#8217; doesn&#8217;t have a default value&#8230;&#8221; </strong>message will display as shown in Diagram 1.<strong></strong></p>
<p>Follow these simple steps to successfully overcome this issue.</p>
<p>Click on Skip to close this window.</p>
<p><img border=1 alt=diagram1.png src="http://www.opensourcevarsity.com/images/mysql/install/mysqlinstall/diagram2.png" width=500 height=383 __1302440137753__="ev_4507465970"><br>Diagram 1</p>
<p>The MySQL Server Instance Configuration wizard opens as shown in Diagram 2. <br clear=all><br>Security could not be applied. Error Number 1364.<strong> </strong>Field &#8216;authentication_string&#8217; doesn&#8217;t have a default value message is displayed.</p>
<p>Red color cross in the circle indicates the failure of complete installation of MySQL as shown in Diagram 2.</p>
<p>Click on cancel to stop the installation procedure as shown in Diagram 2.</p>
<p><img border=1 alt=diagram2.png src="http://www.opensourcevarsity.com/images/mysql/install/mysqlinstall/diagram3.png" width=500 height=96 __1302440137753__="ev_2758012031"><br>Diagram 2</p>
<p>At the desktop Click &gt; Start &gt; Run as shown in Diagram 3.</p>
<p><img border=1 alt=diagram3.png src="http://www.opensourcevarsity.com/images/mysql/install/mysqlinstall/diagram4.png" width=300 height=161 __1302440137753__="ev_9500161020"><br>Diagram 3</p>
<p>In the run text-box enter the command cmd as shown in Diagram 4.</p>
<p><img border=1 alt=diagram4.png src="http://www.opensourcevarsity.com/images/mysql/install/mysqlinstall/diagram5.png" width=500 height=118 __1302440137753__="ev_7545225821"><br>Diagram 4</p>
<p>This opens a Command Window with a Command Prompt visible.</p>
<p>At the Command Prompt enter the following mysql &#8211;uroot to log in to MySQL as shown in Diagram 5.</p>
<p><img border=1 alt=diagram6.png src="http://www.opensourcevarsity.com/images/mysql/install/mysqlinstall/diagram6.png" width=500 height=253 __1302440137753__="ev_7142441146"><br>Diagram 5</p>
<p>Before working with data held within a table it is necessary to inform the MySQL db engine which database holds the tables. The USE command specifies which database the MySQL db engine should set as active.</p>
<p>Use the <em>mysql</em> database as shown in Diagram 7.</p>
<div>
<p>mysql&gt; USE mysql;<br>Database changed</p>
</div>
<p><img border=1 alt=diagram7.png src="http://www.opensourcevarsity.com/images/mysql/install/mysqlinstall/diagram7.png" width=400 height=93 __1302440137753__="ev_2832396474"><br>Diagram 7</p>
<p>Remove the NOT NULL from the authentication_string field in table user by passing following command at the mysql prompt as shown in Diagram 8.</p>
<div>
<p>mysql&gt;ALTER TABLE `mysql`.`user` CHANGE `authentication_string` `authentication_string` TEXT CHARACTER SET utf8 COLLATE utf8_bin NULL ;</p>
</div>
<p><img border=1 alt=diagram8.png src="http://www.opensourcevarsity.com/images/mysql/install/mysqlinstall/diagram8.png" width=500 height=134 __1302440137753__="ev_1690858778"><br>Diagram 8</p>
<p>Quit the command line as shown in Diagram 9.</p>
<div>
<p>mysql&gt;exit;<br>Bye</p>
</div>
<p><img border=1 alt=diagram9.png src="http://www.opensourcevarsity.com/images/mysql/install/mysqlinstall/diagram9.png" width=400 height=152 __1302440137753__="ev_5942604925"><br>Diagram 9</p>
<p>Now you rerun the Instance Configuration wizard by navigating to Start &gt; All Programs &gt; MySQL &gt; MySQL Server 5.5 &gt; MySQL Instance Configuration Wizard as shown in Diagram 10.</p>
<p><img border=1 alt=diagram10.png src="http://www.opensourcevarsity.com/images/mysql/install/mysqlinstall/diagram10.png" width=500 height=57 __1302440137753__="ev_1918817401"><br>Diagram 10</p>
<p>The MySQL Instance Configuration Wizard opens as shown in Diagram 11.</p>
<p>Click on Next to continue with the configuration of MySQL Server 5.5 server instance.</p>
<p><img border=1 alt=diagram11.png src="http://www.opensourcevarsity.com/images/mysql/install/mysqlinstall/diagram11.png" width=500 height=383 __1302440137753__="ev_7989886157"><br>Diagram 11</p>
<p>Select the maintenance option as shown in Diagram12.</p>
<p>Select <em>Reconfigure Instance</em> option to create a new configuration for the instance.</p>
<p>Click on Next to continue with the configuration wizard process as shown in Diagram 12.</p>
<p><img border=1 alt=diagram12.png src="http://www.opensourcevarsity.com/images/mysql/install/mysqlinstall/diagram12.png" width=500 height=383 __1302440137753__="ev_7060291490"><br>Diagram 12</p>
<p>From the MySql Server Instance Configuration Wizard select Standard Configuration and click on Next as shown in Diagram 13.</p>
<p><img border=1 alt=diagram13.png src="http://www.opensourcevarsity.com/images/mysql/install/mysqlinstall/diagram13.png" width=500 height=383 __1302440137753__="ev_3162862128"><br>Diagram 13</p>
<p>Check the checkbox of Include the Bin Directory in Windows PATH and click on Next as shown in Diagram 14.</p>
<p><img border=1 alt=diagram14.png src="http://www.opensourcevarsity.com/images/mysql/install/mysqlinstall/diagram14.png" width=500 height=383 __1302440137753__="ev_7198966251"><br>Diagram 14</p>
<p>Now Configure the MySQL Server instance with your choice of root password as shown in Diagram 11</p>
<p>Current root password: ????????? ( provided earlier while installing MySQL )<br>Enter New Root Password : ????????? ( your choice )<br>Enter Confirm : ???????? ( your choice )<br>Check the check-box of Enable root access from remote machines.<br>Check the check-box of Create Anonymous Account.</p>
<p>Click on Next as shown in Diagram 15.</p>
<p><img border=1 alt=diagram15.png src="http://www.opensourcevarsity.com/images/mysql/install/mysqlinstall/diagram15.png" width=500 height=383 __1302440137753__="ev_4898760566"><br>Diagram 15</p>
<p>The security settings would now successfully be applied to MySQL as shown in Diagram 16.</p>
<p><img border=1 alt=diagram16.png src="http://www.opensourcevarsity.com/images/mysql/install/mysqlinstall/diagram16.png" width=500 height=383 __1302440137753__="ev_1126959727"><br><br><br>或者<br><br>在配置mysql的时候，安装到最后一步 execute <br>执行 第四项apply security settings&nbsp; 的时候出错了&nbsp; 报了1364的错误 <br>后面的错误信息是这样的authentication_string doesn't have a default value&nbsp;</p>
<p>&nbsp;</p>
<p>解决办法：</p>
<p><span style="COLOR: #ff0000">红框中选项不要勾选</span><br>MySQL 5 uses a strict mode which needs to be disabled.<br>In Windows, Goto Start--&gt;Programs--&gt;MySQL-&gt;MySQL Instance Config Wizard. Follow through the Reconfigure Instance option--&gt;Detailed Configuration--&gt;Continue Next a few screens.&nbsp; <br>At the bottom under Enable TCP/IP option there is 'Enable Strict Mode'. Deslect this option (no tick). Save changes and MySQL will restart.</p>
<img src ="http://www.cnitblog.com/MartinYao/aggbug/73311.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cnitblog.com/MartinYao/" target="_blank">玄铁剑</a> 2011-04-10 20:58 <a href="http://www.cnitblog.com/MartinYao/articles/73311.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item></channel></rss>