- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
Mediawiki MySQL 的 CPU 负载有时会很高。
我们有一个 mediawiki,大约有 50 人在线
版本是 1.31
这里是 LocaleSettings.php 的内容
<?php
# This file was automatically generated by the MediaWiki 1.31.0
# installer. If you make manual changes, please keep track in case you
# need to recreate them later.
#
# See includes/DefaultSettings.php for all configurable settings
# and their default values, but don't forget to make changes in _this_
# file, not there.
#
# Further documentation for configuration settings may be found at:
# https://www.mediawiki.org/wiki/Manual:Configuration_settings
# Protect against web entry
if ( !defined( 'MEDIAWIKI' ) ) {
exit;
}
## Uncomment this to disable output compression
# $wgDisableOutputCompression = true;
$wgSitename = "MyWiki";
## The URL base path to the directory containing the wiki;
## defaults for all runtime URL paths are based off of this.
## For more information on customizing the URLs
## (like /w/index.php/Page_title to /wiki/Page_title) please see:
## https://www.mediawiki.org/wiki/Manual:Short_URL
$wgScriptPath = "";
## The protocol and server name to use in fully-qualified URLs
#$wgServer = "https://wikidecode.org";
$wgServer = "https://xxxxxxx.com";
## The URL path to static resources (images, scripts, etc.)
$wgResourceBasePath = $wgScriptPath;
## The URL path to the logo. Make sure you change this from the default,
## or else you'll overwrite your logo when you upgrade!
$wgLogo = "$wgResourceBasePath/resources/assets/wiki.png";
## UPO means: this is also a user preference option
$wgEnableEmail = true;
$wgEnableUserEmail = true; # UPO
$wgEmergencyContact = "apache@xxxxxxx.com";
$wgPasswordSender = "apache@xxxxxxx.com";
$wgEnotifUserTalk = false; # UPO
$wgEnotifWatchlist = false; # UPO
$wgEmailAuthentication = true;
## Database settings
$wgDBtype = "mysql";
$wgDBserver = "127.0.0.1";
$wgDBname = "mediawikidb";
$wgDBuser = "mediawikidb";
$wgDBpassword = "xxxxxxxxxxxxxxxxx";
# MySQL specific settings
$wgDBprefix = "";
$wgSQLMode = null;
# MySQL table options to use during installation or update
$wgDBTableOptions = "ENGINE=InnoDB, DEFAULT CHARSET=binary";
## Shared memory settings
#$wgUseGzip = true;
$wgEnableSidebarCache = true;
$wgMainCacheType = CACHE_MEMCACHED;
$wgParserCacheType = CACHE_MEMCACHED; # optional
$wgMessageCacheType = CACHE_MEMCACHED; # optional
$wgMemCachedServers = array( "127.0.0.1:11211" );
#$wgUseLocalMessageCache = true;
$wgSessionsInObjectCache = true; # optional
$wgSessionCacheType = CACHE_MEMCACHED; # optional
# File cache
$wgUseFileCache = true;
#$wgFileCacheDirectory = "/var/www/mediawiki/file-cache";
$wgFileCacheDirectory = "$IP/cache";
# NO DB HITS!
# Refer to https://techwelkin.com/slow-mediawiki-optimize-to-enhance-performance-part-1
$wgDisableCounters = false;
$wgHitcounterUpdateFreq = 500;
$wgMiserMode = true;
#$wgJobRunRate = 0; // Set a cronjob via "crontab -e" with "0 0 * * * /usr/bin/php /var/www/mediawiki/maintenance/runJobs.php > /var/log/runJobs.log 2>&1"
## Set $wgCacheDirectory to a writable directory on the web server
## to make your wiki go slightly faster. The directory should not
## be publically accessible from the web.
$wgCacheDirectory = "$IP/cache";
## To enable image uploads, make sure the 'images' directory
## is writable, then set this to true:
$wgEnableUploads = true;
#$wgUseImageMagick = true;
#$wgImageMagickConvertCommand = "/usr/bin/convert";
# InstantCommons allows wiki to use images from https://commons.wikimedia.org
$wgUseInstantCommons = false;
$wgRunJobsAsync = true;
# Periodically send a pingback to https://www.mediawiki.org/ with basic data
# about this MediaWiki instance. The Wikimedia Foundation shares this data
# with MediaWiki developers to help guide future development efforts.
$wgPingback = false;
## If you use ImageMagick (or any other shell command) on a
## Linux server, this will need to be set to the name of an
## available UTF-8 locale
$wgShellLocale = "C.UTF-8";
# Site language code, should be one of the list in ./languages/data/Names.php
$wgLanguageCode = "zh";
$wgSecretKey = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx";
# Changing this will log out all existing sessions.
$wgAuthenticationTokenVersion = "1";
# Site upgrade key. Must be set to a string (default provided) to turn on the
# web installer while LocalSettings.php is in place
$wgUpgradeKey = "xxxxxxxxxxxxxx";
## For attaching licensing metadata to pages, and displaying an
## appropriate copyright notice / icon. GNU Free Documentation
## License and Creative Commons licenses are supported so far.
$wgRightsPage = ""; # Set to the title of a wiki page that describes your license/copyright
$wgRightsUrl = "";
$wgRightsText = "";
$wgRightsIcon = "";
# Path to the GNU diff3 utility. Used for conflict resolution.
$wgDiff3 = "/usr/bin/diff3";
## Default skin: you can change the default skin. Use the internal symbolic
## names, ie 'vector', 'monobook':
#$wgDefaultSkin = "minerva";
$wgDefaultSkin = "Timeless";
# Enabled skins.
# The following skins were automatically enabled:
wfLoadSkin( 'MonoBook' );
wfLoadSkin( 'Timeless' );
wfLoadSkin( 'Vector' );
# Enabled extensions. Most of the extensions are enabled by adding
# wfLoadExtensions('ExtensionName');
# to LocalSettings.php. Check specific extension documentation for more details.
# The following extensions were automatically enabled:
wfLoadExtension( 'CategoryTree' );
wfLoadExtension( 'Cite' );
wfLoadExtension( 'CiteThisPage' );
wfLoadExtension( 'CodeEditor' );
wfLoadExtension( 'Gadgets' );
#wfLoadExtension( 'ImageMap' );
wfLoadExtension( 'InputBox' );
wfLoadExtension( 'Interwiki' );
wfLoadExtension( 'LocalisationUpdate' );
wfLoadExtension( 'MultimediaViewer' );
wfLoadExtension( 'OATHAuth' );
wfLoadExtension( 'ParserFunctions' );
wfLoadExtension( 'PdfHandler' );
wfLoadExtension( 'Poem' );
wfLoadExtension( 'Renameuser' );
wfLoadExtension( 'ReplaceText' );
wfLoadExtension( 'SpamBlacklist' );
wfLoadExtension( 'SyntaxHighlight_GeSHi' );
wfLoadExtension( 'TitleBlacklist' );
wfLoadExtension( 'Babel' );
wfLoadExtension( 'cldr' );
wfLoadExtension( 'CleanChanges' );
$wgCCTrailerFilter = true;
$wgCCUserFilter = false;
$wgDefaultUserOptions['usenewrc'] = 1;
wfLoadExtension( 'LocalisationUpdate' );
$wgLocalisationUpdateDirectory = "$IP/cache";
require_once "$IP/extensions/Translate/Translate.php";
$wgGroupPermissions['user']['translate'] = true;
$wgGroupPermissions['user']['translate-messagereview'] = true;
$wgGroupPermissions['user']['translate-groupreview'] = true;
$wgGroupPermissions['user']['translate-import'] = true;
$wgGroupPermissions['sysop']['pagetranslation'] = true;
$wgGroupPermissions['sysop']['translate-manage'] = true;
$wgTranslateDocumentationLanguageCode = 'qqq';
$wgExtraLanguageNames['qqq'] = 'Message documentation'; # No linguistic content. Used for documenting messages
wfLoadExtension( 'UniversalLanguageSelector' );
wfLoadExtension( 'WikiEditor' );
wfLoadExtension( 'Scribunto' );
#$wgScribuntoDefaultEngine = 'luastandalone';
#$wgScribuntoEngineConf['luastandalone']['cpuLimit'] = 'ulimit';
#$wgScribuntoEngineConf['luastandalone']['memoryLimit'] = 209715200; # bytes
$wgScribuntoDefaultEngine = 'luasandbox';
$wgScribuntoEngineConf['luasandbox']['cpuLimit'] = 'ulimit';
$wgScribuntoEngineConf['luasandbox']['memoryLimit'] = 209715200; # bytes
wfLoadExtension( 'Nuke' );
#wfLoadExtension( 'VisualEditor' );
// Enable by default for everybody
# $wgDefaultUserOptions['visualeditor-enable'] = 1;
// Optional: Set VisualEditor as the default for anonymous users
// otherwise they will have to switch to VE
# $wgDefaultUserOptions['visualeditor-editor'] = "visualeditor";
// Don't allow users to disable it
# $wgHiddenPrefs[] = 'visualeditor-enable';
# Parsoid fir Visual Editor
$wgVirtualRestConfig['modules']['parsoid'] = array(
// URL to the Parsoid instance
// Use port 8142 if you use the Debian package
//'url' => 'http://wikidecode.org:8142',
'url' => 'http://xxxxxxx.com:8142',
// Parsoid "domain", see below (optional)
//'domain' => 'localhost',
// Parsoid "prefix", see below (optional)
//'prefix' => 'localhost'
);
# Wikibase
$wgEnableWikibaseRepo = true;
$wgEnableWikibaseClient = true;
require_once "$IP/extensions/Wikibase/repo/Wikibase.php";
require_once "$IP/extensions/Wikibase/repo/ExampleSettings.php";
require_once "$IP/extensions/Wikibase/client/WikibaseClient.php";
require_once "$IP/extensions/Wikibase/client/ExampleSettings.php";
# Mobile responsive display
wfLoadExtension( 'MobileFrontend' );
$wgMFAutodetectMobileView = true;
wfLoadSkin( 'MinervaNeue' );
$wgMFDefaultSkinClass = 'SkinMinerva';
# End of automatically generated settings.
# Add more configuration options below.
# Auto confirm threshold
$wgAutoConfirmCount=20;
# Tidy # Fix the problem that infobox will show <td? </td>
$wgUseTidy=true;
# Permission (need to comment out to make Visual Editor work)
$wgGroupPermissions['*']['read'] = false; # Disable reading by anonymous users
$wgGroupPermissions['*']['edit'] = false;
$wgGroupPermissions['*']['writeapi'] = false;
$wgGroupPermissions['*']['createpage'] = false;
$wgGroupPermissions['*']['createtalk'] = false;
$wgGroupPermissions['*']['createaccount'] = false; # Prevent new user registrations except by sysops
# Debugging
#$wgShowExceptionDetails = true;
#$wgShowDBErrorBacktrace = true;
#$wgShowSQLErrors = true;
#$wgDebugDumpSql = true;
#$wgDebugComments = true;
$wgDebugLogFile = "/var/log/mediawiki/debug-{$wgDBname}.log";
$wgPFEnableStringFunctions = true;
$wgMaxShellMemory = 204800; # in KB
# TemplateStyle
wfLoadExtension( 'TemplateStyles' );
#Youtube
wfLoadExtension( 'YouTube' );
#Embedded Video
wfLoadExtension( 'EmbedVideo' );
# Permission to Hide history
$wgGroupPermissions['sysop']['deletelogentry'] = true;
$wgGroupPermissions['sysop']['deleterevision'] = true;
# Notice
# $wgSiteNotice = "Internal..."
# Upload picture option
# allow upload by URL
$wgAllowCopyUploads = true;
$wgCopyUploadsFromSpecialUpload = true;
# Increase Session timeout
$wgCookieExpiration = 86400;
$wgExtendedLoginCookieExpiration = null;
# Proxy WWW
#$wgUseSquid = true;
#$wgSquidServers = [ 'x.x.x.x' ];
#$wgSquidServersNoPurge = [ 'x.x.x.x' ];
# 貢獻得分
require_once "$IP/extensions/ContributionScores/ContributionScores.php";
$wgContribScoreIgnoreBots = true; // Exclude Bots from the reporting - Can be omitted.
$wgContribScoreIgnoreBlockedUsers = true; // Exclude Blocked Users from the reporting - Can be omitted.
$wgContribScoresUseRealName = true; // Use real user names when available - Can be omitted. Only for MediaWiki 1.19 and later.
$wgContribScoreDisableCache = true; // Set to true to disable cache for parser function and inclusion of table.
//Each array defines a report - 7,50 is "past 7 days" and "LIMIT 50" - Can be omitted.
$wgContribScoreReports = array(
array(7,20),
array(30,20),
array(0,20));
# Change default user behavior
## Add pages the user edits to their watchlist by default
$wgDefaultUserOptions['watchdefault'] = 0; // 不將更改的page加入監視列表
# 允許外部連結顯示圖片
$wgAllowExternalImages=true;
# 開啟濫用日誌
wfLoadExtension( 'AbuseFilter' );
$wgGroupPermissions['sysop']['abusefilter-modify'] = true;
$wgGroupPermissions['*']['abusefilter-log-detail'] = true;
##$wgGroupPermissions['*']['abusefilter-view'] = true;
##$wgGroupPermissions['*']['abusefilter-log'] = true;
$wgGroupPermissions['sysop']['abusefilter-private'] = true;
$wgGroupPermissions['sysop']['abusefilter-modify-restricted'] = true;
$wgGroupPermissions['sysop']['abusefilter-revert'] = true;
# 防止用戶名使用非格式化字串
#wfLoadExtension( 'AntiSpoof' );
#$wgSharedTables[] = 'spoofuser';
# 允許HTML img tag
$wgAllowImageTag=true;
# 必須email驗證
#$wgEmailConfirmToEdit=true;
# Lockdown Permission
wfLoadExtension( 'Lockdown' );
$wgNamespacePermissionLockdown[NS_TEMPLATE]['*'] = ['bureaucrat'];
$wgNamespacePermissionLockdown[NS_TEMPLATE]['read'] = ['*'];
# 網站維護....
#$wgReadOnly = 'Dumping Database, Access will be restored shortly';
# 打開舉報 (註冊用戶可以舉報,管理員處理)
wfLoadExtension( 'Report' );
# 可以看見誰正在監視那個page
wfLoadExtension( 'WhoIsWatching' );
$whoiswatching_nametype = "RealName";
# $wgGroupPermissions['sysop']['addpagetoanywatchlist'] = true;
# $wgGroupPermissions['sysop']['seepagewatchers'] = true;
# 追蹤某個使用者的進出狀況
#require_once "$IP/extensions/StalkerLog/StalkerLog.php";
#$wgGroupPermissions['*']['stalkerlog-view-log'] = false;
#$wgGroupPermissions['sysop']['stalkerlog-view-log'] = true;
# Who is online
wfLoadExtension( 'WhosOnline' );
$wgWhosOnlineShowAnons = true;
# 關閉page view counter
# $wgDisableCounters = true;
#wfLoadExtension( 'MatomoAnalytics' );
#$wgMatomoAnalyticsServerURL=false;
#$wgMatomoAnalyticsTokenAuth=false;
# Check User IP (blocking by IP range)
wfLoadExtension( 'CheckUser' );
#$wgGroupPermissions['sysop']['checkuser'] = true;
#$wgGroupPermissions['sysop']['checkuser-log'] = true;
$wgAddGroups['bureaucrat'][] = 'checkuser';
$wgRemoveGroups['bureaucrat'][] = 'checkuser';
# Local S3 for image
# https://github.com/edwardspec/mediawiki-aws-s3
#wfLoadExtension( 'AWS' );
// Configure AWS credentials.
// THIS IS NOT NEEDED if your EC2 instance has an IAM instance profile.
#$wgAWSCredentials = [
# 'key' => 'xxxxxxxxxxxxxx',
# 'secret' => 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx',
# 'token' => false
#];
#$wgAWSRegion = 'us-west-2'; # Oregon
// Replace <something> with the name of your S3 bucket, e.g. wonderfulbali234.
#$wgAWSBucketName = "mediawiki-uploads";
#$wgUploadDirectory = "$IP/s3mnt";
#$wgUploadPath = "$wgScriptPath/s3mnt";
# Anti-Robot Mechanism
#wfLoadExtension( 'ConfirmEdit' );
#$wgGroupPermissions['*' ]['skipcaptcha'] = false; // Default
#$wgGroupPermissions['user' ]['skipcaptcha'] = false; // Default
#$wgGroupPermissions['autoconfirmed']['skipcaptcha'] = false; // Default
#$wgGroupPermissions['bot' ]['skipcaptcha'] = true; // Default: registered bots
#$wgGroupPermissions['sysop' ]['skipcaptcha'] = true; // Default
#$wgCaptchaTriggers['edit'] = false; // Trigger while editing a page
#$wgCaptchaTriggers['create'] = true; // Default: Trigger while creating a page
#$wgCaptchaTriggers['addurl'] = true; // Default: Trigger while ading a url
#$wgCaptchaTriggers['createaccount'] = true; // Default: Trigger while registering
#$wgCaptchaTriggers['badlogin'] = true; // Default: Trigger while bad login
# Echo to users
wfLoadExtension( 'Echo' );
# Delete a Page permanently
wfLoadExtension( 'DeletePagesForGood' );
$wgGroupPermissions['*']['deleteperm'] = false;
$wgGroupPermissions['user']['deleteperm'] = false;
$wgGroupPermissions['bureaucrat']['deleteperm'] = true;
$wgGroupPermissions['sysop']['deleteperm'] = false;
# Gadgets edit permission
#$wgGroupPermissions['sysop']['gadgets-edit'] = true;
#$wgGroupPermissions['sysop']['gadgets-definition-edit'] = true;
# Addthis
#require_once "$IP/extensions/AddThis/AddThis.php";
#$wgAddThisMain=false;
#$wgAddThisSidebar=false;
# Related Articles
#wfLoadExtension( 'RelatedArticles' );
#$wgRelatedArticlesFooterWhitelistedSkins = ['vector', 'timeless', 'minerva', 'monobook'];
$wgULSGeoService = 'https://freegeoip.app/json/8.8.8.8?callback=?';
# New namespace for private pages
// Define constants for my additional namespaces.
define("NS_FOO", 3000); // This MUST be even.
define("NS_FOO_TALK", 3001); // This MUST be the following odd integer.
// Add namespaces.
$wgExtraNamespaces[NS_FOO] = "Foo";
$wgExtraNamespaces[NS_FOO_TALK] = "Foo_talk"; // Note underscores in the namespace name.
$wgNamespaceProtection[NS_FOO] = array( 'editfoo' ); // permission "editfoo" required to edit the foo namespace
$wgNamespacesWithSubpages[NS_FOO] = true; // subpages enabled for the foo namespace
$wgGroupPermissions['staff']['editfoo'] = true; // permission "editfoo" granted to users in the "staff" group
$wgNamespacePermissionLockdown[NS_FOO]['read'] = ['staff'];
有时 mysqld 会占用所有 cpu 资源,而 nginx 会显示 504 网关超时。这是mysql慢查询日志的一部分:
# Time: 2018-12-04T17:13:53.679634Z
# User@Host: root[root] @ localhost [127.0.0.1] Id: 82845
# Query_time: 3.868103 Lock_time: 0.000066 Rows_sent: 6 Rows_examined: 14
SET timestamp=1543943633;
SELECT /* SearchMySQL::searchInternal */ page_id,page_namespace,page_title FROM `page`,`searchindex` WHERE (page_id=si_page) AND ( MATCH(si_text) AGAINST('+\"u8e7ae80 u8c2b7 u8e696b9 u8e8bebe\" ' IN BOOLEAN MODE) ) AND page_namespace IN ('0','120') LIMIT 20;
# Time: 2018-12-04T17:13:57.542743Z
# User@Host: root[root] @ localhost [127.0.0.1] Id: 82845
# Query_time: 3.861802 Lock_time: 0.000104 Rows_sent: 1 Rows_examined: 14
SET timestamp=1543943637;
SELECT /* SearchMySQL::searchInternal */ COUNT(*) as c FROM `page`,`searchindex` WHERE (page_id=si_page) AND ( MATCH(si_text) AGAINST('+\"u8e7ae80 u8c2b7 u8e696b9 u8e8bebe\" ' IN BOOLEAN MODE) ) AND page_namespace IN ('0','120');
我不确定主要问题是什么,是 MySQL 设置还是 Mediawiki 还是只需要升级硬件?
我已经多次尝试更改 mysql 设置,但没有解决。
这是我的 mysqld.cnf:
#
# The MySQL database server configuration file.
#
# You can copy this to one of:
# - "/etc/mysql/my.cnf" to set global options,
# - "~/.my.cnf" to set user-specific options.
#
# One can use all long options that the program supports.
# Run program with --help to get a list of available options and with
# --print-defaults to see which it would actually understand and use.
#
# For explanations see
# http://dev.mysql.com/doc/mysql/en/server-system-variables.html
# This will be passed to all mysql clients
# It has been reported that passwords should be enclosed with ticks/quotes
# escpecially if they contain "#" chars...
# Remember to edit /etc/mysql/debian.cnf when changing the socket location.
# Here is entries for some specific programs
# The following values assume you have at least 32M ram
[mysqld_safe]
socket = /var/run/mysqld/mysqld.sock
nice = 0
[mysqld]
#
# * Basic Settings
#
user = mysql
pid-file = /var/run/mysqld/mysqld.pid
socket = /var/run/mysqld/mysqld.sock
port = 3306
basedir = /usr
datadir = /var/lib/mysql
tmpdir = /tmp
lc-messages-dir = /usr/share/mysql
skip-external-locking
#
# Instead of skip-networking the default is now to listen only on
# localhost which is more compatible and is not less secure.
bind-address = 127.0.0.1
#
# * Fine Tuning
#
key_buffer_size = 512M
max_allowed_packet = 16M
thread_stack = 192K
thread_cache_size = 32
# This replaces the startup script and checks MyISAM tables if needed
# the first time they are touched
myisam-recover-options = BACKUP
#max_connections = 100
#table_cache = 64
#thread_concurrency = 10
#
# * Query Cache Configuration
#
query_cache_type = 0
query_cache_limit = 2M
query_cache_size = 0
#
# * Logging and Replication
#
# Both location gets rotated by the cronjob.
# Be aware that this log type is a performance killer.
# As of 5.1 you can enable the log at runtime!
#general_log_file = /var/log/mysql/mysql.log
#general_log = 1
#
# Error log - should be very few entries.
#
log_error = /var/log/mysql/error.log
#
# Here you can see queries with especially long duration
slow_query_log = 1
slow_query_log_file = /var/log/mysql/mysql-slow.log
#log_slow_queries = /var/log/mysql/mysql-slow.log
long_query_time = 1
#log-queries-not-using-indexes
#
# The following can be used as easy to replay backup logs or for replication.
# note: if you are setting up a replication slave, see README.Debian about
# other settings you may need to change.
#server-id = 1
#log_bin = /var/log/mysql/mysql-bin.log
expire_logs_days = 10
max_binlog_size = 100M
#binlog_do_db = include_database_name
#binlog_ignore_db = include_database_name
#
# * InnoDB
#
# InnoDB is enabled by default with a 10MB datafile in /var/lib/mysql/.
# Read the manual for more InnoDB related options. There are many!
#
# * Security Features
#
# Read the manual, too, if you want chroot!
# chroot = /var/lib/mysql/
#
# For generating SSL certificates I recommend the OpenSSL GUI "tinyca".
#
# ssl-ca=/etc/mysql/cacert.pem
# ssl-cert=/etc/mysql/server-cert.pem
# ssl-key=/etc/mysql/server-key.pem
#add
table_open_cache = 432
innodb_buffer_pool_instances = 1
innodb_buffer_pool_size = 1G
innodb_log_file_size = 128M
硬件是 Amazon EC2 c5.large
操作系统版本:Ubuntu 16.04.5
MySQL 版本:Ver 14.14 Distrib 5.7.24,适用于使用 EditLine 包装器的 Linux (x86_64)
最佳答案
我找到了原因。可能是MyISAM引擎锁问题,搜索索引默认使用 MyISAM 引擎。我尝试将引擎更改为 innoDB。(但你的MySQL版本要高于5.6)
关于mysql - Mediawiki MySQL 的 CPU 负载有时很高,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53619972/
目前我正在构建相当大的网络系统,我需要强大的 SQL 数据库解决方案。我选择 Mysql 而不是 Postgres,因为一些任务需要只读(MyISAM 引擎)而其他任务需要大量写入(InnoDB)。
我在 mysql 中使用如下命令。当它显示表格数据时,它被格式化为一个非常干净的表格,间距均匀且 |作为列分隔符。 SELECT * FROM TABLE_NAME; 当我从 CLI 运行命令时,如下
我知道这个问题之前已经被问过好几次了,我已经解决了很多问题,但到目前为止没有任何效果。 MySQL 试图将自身安装到的目录 (usr/local/mysql) 肯定有问题。关于我的错误的奇怪之处在于我
以下是我的 SQL 数据结构,我正在尝试如下两个查询: Select Wrk_ID, Wrk_LastName, Skill_Desc from Worker, Skill where
我们有一个本地 mysql 服务器(不在公共(public)域上),并希望将该服务器复制到我们拥有的 google 云 sql 实例。我的问题是:1.这可能吗?2.我们的本地服务器只能在本地网络上访问
我有一个表(test_table),其中一些字段值(例如字段 A、B 和 C)是从外部应用程序插入的,还有一个字段(字段 D),我想从现有表(store_table)插入其值,但在插入前者(A、B 和
我想创建一个 AWS RDS 实例,然后使用 terraform 管理数据库用户。因此,首先,我创建了一个 RDS 实例,然后使用创建的 RDS 实例初始化 mysql 提供程序,以进一步将其用于用户
当用户在我的网站上注册时,他们会在我的一个数据库中创建自己的表格。该表存储用户发布的所有帖子。我还想做的是也为他们生成自己的 MySql 用户——该用户仅有权从他们的表中读取、写入和删除。 创建它应该
我有一个关于 ColdFusion 和 Mysql 的问题。我有两个表:PRODUCT 和 PRODUCT_CAT。我想列出包含一些标记为:IS_EXTRANET=1 的特殊产品的类别。所以我写了这个
我想获取 recipes_id 列的值,以获取包含 ingredient_id 的 2,17 和 26 条目的值。 假设 ingredient_id 2 丢失则不获取记录。 我已经尝试过 IN 运算符
在 Ubuntu 中,我通常安装两者,但 MySQL 的客户端和服务器之间有什么区别。 作为奖励,当一个新语句提到它需要 MySQL 5.x 时,它是指客户端、服务器还是两者兼而有之。例如这个链接ht
我重新访问了我的数据库并注意到我有一些 INT 类型的主键。 这还不够独特,所以我想我会有一个指导。 我来自微软 sql 背景,在 ssms 中你可以 选择类型为“uniqeidentifier”并自
我的系统上有 MySQL,我正在尝试确定它是 Oracle MySQL 还是 MySQL。 Oracle MySQL 有区别吗: http://www.oracle.com/us/products/m
我是在生产 MySQL 中运行的应用程序的新维护者。之前的维护者已经离开,留下的文档很少,而且联系不上了。 我面临的问题是执行以下请求大约需要 10 秒: SELECT COUNT(*) FROM `
我有两个位于不同机器上的 MySQL 数据库。我想自动将数据从一台服务器传输到另一台服务器。比方说,我希望每天早上 4:00 进行数据传输。 可以吗?是否有任何 MySQL 内置功能可以让我们做到这一
有什么方法可以使用 jdbc 查询位于 mysql 根目录之外的目录中的 mysql 表,还是必须将它们移动到 mysql 根目录内的数据库文件夹中?我在 Google 上搜索时没有找到任何东西。 最
我在 mysql 数据库中有两个表。成员和 ClassNumbers。两个表都有一个付费年份字段,都有一个代码字段。我想用代码数字表中的值更新成员表中的付费年份,其中成员中的代码与 ClassNumb
情况:我有 2 台服务器,其中一台当前托管一个实时 WordPress 站点,我希望能够将该站点转移到另一台服务器,以防第一台服务器出现故障。传输源文件很容易;传输数据库是我需要弄清楚如何做的。两台服
Phpmyadmin 有一个功能是“复制数据库到”..有没有mysql查询来写这个函数?类似于将 db A 复制到新的 db B。 最佳答案 首先创建复制数据库: CREATE DATABASE du
我有一个使用 mySQL 作为后端的库存软件。我已经在我的计算机上对其进行了测试,并且运行良好。 当我在计算机上安装我的软件时,我必须执行以下步骤: 安装 mySQL 服务器 将用户名指定为“root
我是一名优秀的程序员,十分优秀!