Ⅰ 如何利用sourceforge的免費空間免費資料庫建站
步驟:
1、創建一個SourceForge賬號並登錄
傳送門在這里。
2、創建一個項目
右上角 Me → Profile → Create a Project
project name,如firstlog,URL Name,如firstlog,於是你得到一個項目的地址:
http://sourceforge.net/p/firstlog
3、修改項目屬性
登錄https://sourceforge.net/p/firstlog,左側有下面幾個標簽,
Metadata Screenshots Categorization Tools User Permissions Audit Trail
我們重點用到的是Tools。點擊進去~
4、配置mysql資料庫
在Tools中找到MySQL Databases並點擊進行安裝。
安裝後到頁面最下端找到MySQL,點擊Admin MySQL Databases,進入配置資料庫階段。
在配置頁面中的Setting部分,可以看到只讀、讀寫、管理員賬戶的用戶名以及mysql的地址https://mysql-f.sourceforge.net,在下面的Password部分需要設置三個賬戶的密碼。
打開https://mysql-f.sourceforge.net,並輸入用戶名以及上面設置的密碼,即可通過網頁管理資料庫。
5、配置svn
同mysql配置。
6、配置git
同mysql配置。
7、配置域名
同樣在Tools下安裝VHOST,在頁面下方找到VHOST,點擊Set Project Web vhosts,進入後將你的新域名,如「www.firstlog.net"填到New virtual host中並Create。然後在你的域名服務商那裡,我的是萬網,在域名解析里增加CNAME值為vhost.sourceforge.net。大概需要等一個多小時,新域名生效。
8、配置文件傳輸
打開WinSCP,協議名SFTP,主機名web.sourceforge.net,用戶名為"你的sf賬戶用戶名,項目名",如"bbdlg,firstlog",密碼為你的sf密碼。
9、hello world~
寫如下內容到 index.php 中,
?
1
2
3
<?php
echo "hallo world!";
?>
上傳index.php到htdocs中,在瀏覽器中輸入 www.firstlog.net 即可看到我們的hallo world了。
Ⅱ centos怎麼安裝mysql
當前位置: > CentOS伺服器 > 資料庫伺服器 > MySQL >
centos6.5下安裝mysql
時間:2014-08-12 01:11來源:blog.csdn.net 作者:brushli 舉報 點擊:17509次
1.使用yum命令安裝mysql
[html] view plain
[root@bogon ~]# yum -y install mysql-server
2.設置開機啟動
[html] view plain
[root@bogon ~]# chkconfig mysqld on
3.啟動MySQL服務
[html] view plain
[root@bogon ~]# service mysqld start
4.設置MySQL的root用戶設置密碼
[html] view plain
[root@bogon ~]# mysql -u root
mysql> select user,host,password from mysql.user;
+------+-----------+----------+
| user | host | password |
+------+-----------+----------+
| root | localhost | |
| root | bogon | |
| root | 127.0.0.1 | |
| | localhost | |
| | bogon | |
+------+-----------+----------+
5 rows in set (0.01 sec)
查詢用戶的密碼,都為空,用下面的命令設置root的密碼為root
[html] view plain
mysql> set password for root@localhost=password('root');
mysql> exit
5.用新密碼登陸
[html] view plain
[root@bogon ~]# mysql -u root -p
Enter password:
6.創建mysql新用戶test_user
[html] view plain
mysql> create user 'test_user'@'%' identified by 'test_user';
Query OK, 0 rows affected (0.00 sec)
7.給新用戶test_user授權,讓他可以從外部登陸和本地登陸
注意:@左邊是用戶名,右邊是域名、IP和%,表示可以訪問mysql的域名和IP,%表示外部任何地址都能訪問。
[html] view plain
mysql> grant all privileges on *.* to 'test_user'@'localhost' identified by 'test_user';
Query OK, 0 rows affected (0.00 sec)
mysql> grant all privileges on *.* to 'test_user'@'%' identified by 'test_user';
Query OK, 0 rows affected (0.00 sec)
mysql> select user,host,password from mysql.user;
+----------+-----------+-------------------------------------------+
| user | host | password |
+----------+-----------+-------------------------------------------+
| root | localhost | * |
| root | bogon | |
| root | 127.0.0.1 | |
| | localhost | |
| | bogon | |
| test_user | % | * |
| test_user | localhost | * |
+----------+-----------+-------------------------------------------+
7 rows in set (0.00 sec)
mysql> flush privileges;
Query OK, 0 rows affected (0.01 sec)
8.查看mysql5.1的默認存儲引擎
從下面的執行結果可以看出,mysql的默認引擎是MyISAM,這個引擎是不支持事務的。
[html] view plain
mysql> show engines;
+------------+---------+------------------------------------------------------------+--------------+------+------------+
| Engine | Support | Comment | Transactions | XA | Savepoints |
+------------+---------+------------------------------------------------------------+--------------+------+------------+
| MRG_MYISAM | YES | Collection of identical MyISAM tables | NO | NO | NO |
| CSV | YES | CSV storage engine | NO | NO | NO |
| MyISAM | DEFAULT | Default engine as of MySQL 3.23 with great performance | NO | NO | NO |
| InnoDB | YES | Supports transactions, row-level locking, and foreign keys | YES | YES | YES |
| MEMORY | YES | Hash based, stored in memory, useful for temporary tables | NO | NO | NO |
+------------+---------+------------------------------------------------------------+--------------+------+------------+
5 rows in set (0.00 sec)
也可以以下面的方式查看
[html] view plain
mysql> show variables like 'storage_engine';
+----------------+--------+
| Variable_name | Value |
+----------------+--------+
| storage_engine | MyISAM |
+----------------+--------+
1 row in set (0.00 sec)
9.修改mysql的默認引擎為InnoDB
9.1 停止mysql
[html] view plain
mysql> exit;
[root@bogon ~]# service mysqld stop
9.2 修改/etc/my.cnf
[mysqld] 後加入
[html] view plain
default-storage-engine=InnoDB
加入後my.cnf的內容為:
[html] view plain
[root@bogon etc]# more my.cnf
[mysqld]
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
user=mysql
# Disabling symbolic-links is recommended to prevent assorted security risks
symbolic-links=0
default-storage-engine=InnoDB
[mysqld_safe]
log-error=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid
9.3 啟動mysql
[html] view plain
[root@bogon etc]# service mysqld start
Starting mysqld: [ OK ]
9.4 查看mysql默認存儲引擎
[html] view plain
[root@bogon etc]# mysql -u root -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 2
Server version: 5.1.73 Source distribution
Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql> show variables like 'storage_engine';
+----------------+--------+
| Variable_name | Value |
+----------------+--------+
| storage_engine | InnoDB |
+----------------+--------+
1 row in set (0.00 sec)
10.CentOS6.5開放mysql埠3306
CentOS6.5默認是不開放埠的,如果要讓外部的系統訪問CentOS6.5上的mysql,必須開放mysql的埠3306
10.1 修改/etc/sysconfig/iptables
添加下面一行
[html] view plain
-A INPUT -m state --state NEW -m tcp -p tcp --dport 3306 -j ACCEPT
修改後iptables中的內容是
[html] view plain
[root@bogon etc]# more /etc/sysconfig/iptables
# Firewall configuration written by system-config-firewall
# Manual customization of this file is not recommended.
*filter
:INPUT ACCEPT [0:0]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [0:0]
-A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
-A INPUT -p icmp -j ACCEPT
-A INPUT -i lo -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 22 -j ACCEPT
#添加配置項
-A INPUT -m state --state NEW -m tcp -p tcp --dport 80 -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 11211 -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 3306 -j ACCEPT
-A INPUT -j REJECT --reject-with icmp-host-prohibited
-A FORWARD -j REJECT --reject-with icmp-host-prohibited
COMMIT
11.重啟防火牆
[html] view plain
[root@bogon etc]# service iptables restart
這樣就可以從外部訪問mysql了。
至此,mysql在CentOS6.5上的安裝過程、用戶創建、外部訪問的步驟全部完成。
Ⅲ SQL Server選擇題求助
B
B
D
B
A
D
B
C
A
A
B
C
D
Ⅳ 多線程 連接資料庫,C#多線程寫資料庫
多線程連接資料庫的連接池類:
public static class ConnectionPool
{
private static object locker = new object();
private static Dictionary<string, SqlConnection> Connections = null;
public static SqlConnection GetConnection<T>() where T : class, new()
{
string databaseName = NA.Common.Extensions.GetDatabaseName<T>();
if (string.IsNullOrEmpty(databaseName))
return null;
if (Connections == null)
{
lock (locker)
{
Connections = new Dictionary<string, SqlConnection>();
}
}
string connKey = FindFreeSqlConnection(databaseName);
if (connKey != null)
return Connections[connKey];
else
{
string strconn = NA.Common.Extensions.GetConnectionString<T>();
int poolSize = NA.Common.Extensions.GetConnectionPoolSize<T>();
lock (locker)
{
for (int i = 0; i < poolSize; ++i)
{
SqlConnection conn = new SqlConnection(strconn);
conn.Open();
Connections.Add(databaseName + "_" + i.ToString(), conn);
conn.Close();
}
}
return Connections[FindFreeSqlConnection(databaseName)];
}
}
private static string FindFreeSqlConnection(string databaseName)
{
IEnumerable<string> connKeys = Connections.Keys.Where(item => item.StartsWith(databaseName));
if (connKeys != null && connKeys.Count() > 0)
{
foreach (string key in connKeys)
{
if (Connections[key].State == ConnectionState.Closed)
return key;
}
}
return null;
}
}
附加上其中用到的三個方法:
internal static int GetConnectionPoolSize<T>() where T : class, new()
{
string database = GetDatabaseName<T>();
string[] poolSizeArray = ConfigurationManager.AppSettings["ConnectionsPoolSize"].Split('|');
if (poolSizeArray != null)
{
foreach (string sizeItem in poolSizeArray)
{
string[] sizeItemArray = sizeItem.Split(':');
if (database == sizeItemArray[0])
return int.Parse(sizeItemArray[1]);
}
}
return 50;
}
public static string GetConnectionString<T>() where T : class, new()
{
string tableName = GetTableName<T>();
string[] databaseArray = ConfigurationManager.AppSettings["DatabaseArray"].Split('|');
if (databaseArray != null)
{
foreach (string database in databaseArray)
{
string tableNameList = ConfigurationManager.AppSettings[database];
string[] tables = ConfigurationManager.AppSettings[database].Split('|');
if (tables != null && tables.Length > 0)
if (tables.Contains(tableName))
return ConfigurationManager.ConnectionStrings[database].ConnectionString;
}
}
return string.Empty;
}
public static string GetDatabaseName<T>() where T : class, new()
{
string tableName = GetTableName<T>();
string[] databaseArray = ConfigurationManager.AppSettings["DatabaseArray"].Split('|');
if (databaseArray != null)
{
foreach (string database in databaseArray)
{
string tableNameList = ConfigurationManager.AppSettings[database];
string[] tables = ConfigurationManager.AppSettings[database].Split('|');
if (tables != null && tables.Length > 0)
if (tables.Contains(tableName))
return database;
}
}
return string.Empty;
}
Ⅳ 資料庫題目
所有題目:DACBBD
有問題再追問,望採納。
Ⅵ 欄位太小而不能接受所要添加的數據的數量
設置為備注型欄位。
Ⅶ 什麼是BBD / 網路技術編程
網路編程從大的方面說就是對信息的發送到接收,中間傳輸為物理線路的作用。
網路編程最主要的工作就是在發送端把信息通過規定好的協議進行組裝包,在接收端按照規定好的協議把包進行解析,從而提取出對應的信息,達到通信的目的。中間最主要的就是數據包的組裝,數據包的過濾,數據包的捕獲,數據包的分析,當然最後再做一些處理,代碼、開發工具、資料庫、伺服器架設和網頁設計這5部分你都要接觸。
Ⅷ 資料庫的問題
DCBDC ACAAC BBDCD