ubuntu下没有比较好用的Mysql的GUI客户端,所以安装了phpmyadmin,安装步骤如下:
sudo apt-get install -y phpmyadmin
这时在地址栏里输入http://localhost/phpmyadmin/回车,会发现浏览器一片空白,这时需要修改一些目录的权限,如下:
sudo chown -R www-data:www-data /etc/phpmyadmin/ sudo chown -R www-data:www-data /usr/share/phpmyadmin/ sudo chown -R www-data:www-data /var/lib/phpmyadmin/
注:www-data:www-data是apache的用户和组
phpmyadmin有三种认证方式config,cookie和http,在cookie和http都需要输入密码,config方式是把用户名和密码写入配置文件,登录时无需输入用户名和密码,直接就可以登录,config的认证方式适合本地phpmyadmin用。
下面是config方式认证的部分配置文件(config.inc.php):
$dbname = 'yourip'; /* Authentication type */ $cfg['Servers'][$i]['auth_type'] = 'config'; $cfg['Servers'][$i]['user'] = 'youruser'; $cfg['Servers'][$i]['password'] = 'yourpassword'; /* Server parameters */ $cfg['Servers'][$i]['host'] = $dbname; $cfg['Servers'][$i]['connect_type'] = 'tcp'; $cfg['Servers'][$i]['compress'] = false; /* Select mysqli if your server has it */ $cfg['Servers'][$i]['extension'] = 'mysql'; /* Optional: User for advanced features */ $cfg['Servers'][$i]['controluser'] = 'pma'; $cfg['Servers'][$i]['controlpass'] = 'pmapass'; /* Optional: Advanced phpMyAdmin features */ $cfg['Servers'][$i]['pmadb'] = $dbname; $cfg['Servers'][$i]['bookmarktable'] = 'pma_bookmark'; $cfg['Servers'][$i]['relation'] = 'pma_relation'; $cfg['Servers'][$i]['table_info'] = 'pma_table_info'; $cfg['Servers'][$i]['table_coords'] = 'pma_table_coords'; $cfg['Servers'][$i]['pdf_pages'] = 'pma_pdf_pages'; $cfg['Servers'][$i]['column_info'] = 'pma_column_info'; $cfg['Servers'][$i]['history'] = 'pma_history'; $cfg['Servers'][$i]['designer_coords'] = 'pma_designer_coords'; /* Uncomment the following to enable logging in to passwordless accounts, * after taking note of the associated security risks. */ $cfg['Servers'][$i]['AllowNoPassword'] = TRUE; $i++;
下面是具体的安装步骤
注:安装过程和直接用光盘安装基本一致,唯一要注意的一点就是操作系统的grub默认写入U盘,这样的话没有U盘,安装好的linux都不能启动。
解决方法:这个需要在选择分区时,选择检验和修改分区方案,这步是为了能出现grub选择的页面
.png)
接下来的磁盘划分略过,进入grub配置页面,要按grub引导放在哪个盘,如果是U盘,则要修改,选择配置高级引导装载程序选项,下一步
.png)
改变驱动器顺序,将硬盘移至上方即可
.png)
后续的步骤又和DVD安装一样了
出错原因:git需要一个默认的邮箱和用户名,而刚安装的git并没有进行配置。
解决办法:打开终端,输入下面的两条命令
git config --global user.email "you@example.com" git config --global user.name "Your Name"
Ubuntu下安装一个mac主题
sudo add-apt-repository ppa:noobslab/themes sudo apt-get update sudo apt-get install mac-ithemes-v3 sudo apt-get install mac-icons-v3 sudo apt-get install unity-tweak-tool
打开tweak选择自己喜欢的mac主题和图标
今天遇到一个很有意思的问题,用jquery操作select列表框,动态将某个option的selected属性赋为"selected",在火狐和chrom下都能实现其赋值,但是在火狐下select列表框的文本并没有变化,在chrome下是有变化的,chrome下是正确的结果,也是我想要的结果。网上查了一下,原来处理让option选中的方法有问题。
html代码
<select id="dict1">
<option class="dict1_all" value="0">全部</option>
<option value="1">root</option>
<option value="8">root1</option>
<option value="9">root2</option>
</select>
<select id="dict2">
<option class="dict2_all" value="0">全部</option>
<option style="display: none;" class="fid_1" value="2">子类1</option>
<option style="display: none;" class="fid_1" value="3">子类2</option>
<option style="" class="fid_8" value="4">子类3</option>
</select>
JS代码
$('#dict1').change(function() {
var dictId = $(this).val();
//下面这种方法,再FF下赋值是成功的,但是select列表框的文本不会变化,在chrome下会变化
//$('#dict2 .dict2_all').attr('selected', 'true');
//下面这种方法,可以使select列表框的文本发生变化
$('#dict2').val(0);
if(dictId !== 0) {
$('#dict2').children().not('.dict2_all').hide();
$('#dict2 .fid_' + dictId).show();
}
});